Skip to content

Commit

Permalink
Activate Sentry tracing and profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
noracato committed Sep 13, 2024
1 parent b110238 commit 586e74e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 22 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ gem 'dalli'
gem 'term-ansicolor', '1.0.7', require: false
gem 'highline', require: false

# sentry gems
gem "stackprof"
gem 'sentry-ruby'
gem "sentry-rails"
gem "sentry-sidekiq"
Expand Down
50 changes: 28 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bigdecimal (3.1.8)
bindata (2.5.0)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.10.3)
msgpack (~> 1.2)
builder (3.2.4)
builder (3.3.0)
byebug (11.1.3)
cancancan (3.3.0)
capybara (3.38.0)
Expand All @@ -165,7 +166,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.3.1)
concurrent-ruby (1.3.4)
config (4.1.0)
deep_merge (~> 1.2, >= 1.2.1)
dry-validation (~> 1.0, >= 1.0.0)
Expand Down Expand Up @@ -235,7 +236,7 @@ GEM
zeitwerk (~> 2.6)
equalizer (0.0.11)
erb-formatter (0.3.0)
erubi (1.12.0)
erubi (1.13.0)
execjs (2.8.1)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -310,6 +311,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
local_time (2.1.0)
logger (1.6.1)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -320,15 +322,15 @@ GEM
net-smtp
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
mini_racer (0.6.2)
libv8-node (~> 16.10.0.0)
minitest (5.23.1)
minitest (5.25.1)
msgpack (1.4.5)
multi_json (1.15.0)
mysql2 (0.5.6)
Expand All @@ -344,16 +346,16 @@ GEM
netrc (0.11.0)
newrelic_rpm (8.5.0)
nio4r (2.7.0)
nokogiri (1.16.5)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.5-aarch64-linux)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-darwin)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
numo-narray (0.9.2.0)
orm_adapter (0.5.0)
Expand All @@ -371,7 +373,7 @@ GEM
public_suffix (5.0.0)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.8.0)
racc (1.8.1)
rack (2.2.9)
rack-cors (1.1.1)
rack (>= 2.0.0)
Expand Down Expand Up @@ -410,11 +412,11 @@ GEM
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rake (13.2.1)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis-client (0.17.0)
redis-client (0.22.2)
connection_pool
regexp_parser (2.6.1)
responders (3.0.1)
Expand Down Expand Up @@ -475,21 +477,23 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.7.0)
sentry-rails (5.19.0)
railties (>= 5.0)
sentry-ruby (~> 5.7.0)
sentry-ruby (5.7.0)
sentry-ruby (~> 5.19.0)
sentry-ruby (5.19.0)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
sentry-sidekiq (5.7.0)
sentry-ruby (~> 5.7.0)
sentry-sidekiq (5.19.0)
sentry-ruby (~> 5.19.0)
sidekiq (>= 3.0)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
sidekiq (7.1.3)
sidekiq (7.3.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
logger
rack (>= 2.2.4)
redis-client (>= 0.14.0)
redis-client (>= 0.22.2)
simple_form (5.1.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
Expand All @@ -504,6 +508,7 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
stackprof (0.2.25)
stimulus-rails (1.2.1)
railties (>= 6.0.0)
strscan (3.1.0)
Expand All @@ -522,7 +527,7 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
text-table (1.2.4)
thor (1.3.1)
thor (1.3.2)
thread_safe (0.3.6)
tilt (2.0.10)
timeout (0.4.1)
Expand Down Expand Up @@ -559,7 +564,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.13)
zeitwerk (2.6.18)

PLATFORMS
aarch64-linux
Expand Down Expand Up @@ -641,6 +646,7 @@ DEPENDENCIES
simple_form
simplecov (~> 0.7.1)
sprockets-rails
stackprof
stimulus-rails
tailwindcss-rails
term-ansicolor (= 1.0.7)
Expand Down
10 changes: 10 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@
# This sends information such as the query params and request body, and IP address. Sentry is
# configured to filter out and not store the IP address since we only want the params and body.
config.send_default_pii = true

config.breadcrumbs_logger = [:active_support_logger, :http_logger]

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
config.traces_sample_rate = ENV.fetch('SENTRY_TRACES', 1.0)

# Set profiles_sample_rate to profile 100%
# of sampled transactions.
config.profiles_sample_rate = ENV.fetch('SENTRY_PROFILES', 1.0)
end

0 comments on commit 586e74e

Please sign in to comment.