Skip to content

Commit

Permalink
Add sentry for production use (if SENTRY_DSN set)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierke committed Nov 6, 2023
1 parent 2c64f95 commit c312dcb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ group :production do
gem 'aws-sdk-s3', require: false
gem 'redis'
gem 'hiredis-client'

gem 'sentry-ruby'
gem 'sentry-rails'
end

group :development, :test do
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.12.0)
railties (>= 5.0)
sentry-ruby (~> 5.12.0)
sentry-ruby (5.12.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
sidekiq (7.2.0)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
Expand Down Expand Up @@ -369,6 +374,8 @@ DEPENDENCIES
redis
rspec-rails (~> 6.0)
selenium-webdriver (~> 4.14)
sentry-rails
sentry-ruby
sidekiq (< 8)
sidekiq-failures
sprockets-rails
Expand Down
7 changes: 7 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if ENV["SENTRY_DSN"].present?
Sentry.init do |config|
config.dsn = ENV["SENTRY_DSN"]
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
config.traces_sample_rate = 0.6
end
end

0 comments on commit c312dcb

Please sign in to comment.