Skip to content

Commit

Permalink
differentiate envs for better Sentry logging
Browse files Browse the repository at this point in the history
  • Loading branch information
toufali committed Feb 22, 2024
1 parent 63a5f52 commit 2f64963
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# frozen_string_literal: true

# RAILS_ENV is set to 'production' for both stage and prod servers.
# We use LOCAL_DOMAIN to differentiate for better Sentry logging.
local_domain = ENV.fetch('LOCAL_DOMAIN', nil)

Sentry.init do |config|
config.environment = if local_domain['mozilla.social']
'production'
elsif local_domain['stage']
'staging'
else
'development'
end

config.dsn = 'https://def412573e2b44d39e73a130b09bb25a@o1069899.ingest.sentry.io/4506591637471232'
config.breadcrumbs_logger = [:active_support_logger, :http_logger]

Expand Down

0 comments on commit 2f64963

Please sign in to comment.