Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Sentry Rails monitoring in production environments #14

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

# Monitor errors and performance
gem "sentry-ruby"
gem "sentry-rails"

# Add optimized Active Record association methods
gem "activerecord-has_some_of_many"

Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.22.4)
railties (>= 5.0)
sentry-ruby (~> 5.22.4)
sentry-ruby (5.22.4)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
shellany (0.0.1)
shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
Expand Down Expand Up @@ -603,6 +609,8 @@ DEPENDENCIES
rubocop-rspec
rubocop-rspec_rails
selenium-webdriver (~> 4.27)
sentry-rails
sentry-ruby
shoulda-matchers
solid_cable
solid_cache
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 @@
Sentry.init do |config|
return unless Rails.env.production?

config.dsn = "https://[email protected]/218"
config.breadcrumbs_logger = [:active_support_logger, :http_logger]

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

config.release = ENV["CONTAINER_VERSION"] if ENV["CONTAINER_VERSION"].present?
end
Loading