Skip to content

Commit

Permalink
chore: add Sentry errors monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas committed Nov 6, 2024
1 parent db502a9 commit fa13383
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,9 @@ group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end

group :production do
# Monitoring and error reporting
gem "sentry-rails"
gem "sentry-ruby"
end
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ GEM
rubocop-rspec (~> 3, >= 3.0.1)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
sentry-rails (5.21.0)
railties (>= 5.0)
sentry-ruby (~> 5.21.0)
sentry-ruby (5.21.0)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
shellany (0.0.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -395,6 +401,8 @@ DEPENDENCIES
rubocop-rails
rubocop-rspec
rubocop-rspec_rails
sentry-rails
sentry-ruby
sprockets-rails
stimulus-rails
turbo-rails
Expand Down
13 changes: 13 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

if defined?(Sentry)
Sentry.init do |config|
config.dsn = ENV.fetch("SENTRY_DSN")
config.breadcrumbs_logger = %i[active_support_logger http_logger]

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
config.traces_sample_rate = 0.5
end
end

0 comments on commit fa13383

Please sign in to comment.