-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6742 Replace New Relic with Sentry (#4865)
- Loading branch information
1 parent
121c964
commit 26e80a8
Showing
9 changed files
with
50 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
if Rails.env.production? || Rails.env.staging? | ||
Sentry.init do |config| | ||
# get breadcrumbs from logs | ||
config.breadcrumbs_logger = [:active_support_logger, :http_logger] | ||
|
||
# enable tracing | ||
config.traces_sampler = lambda do |sampling_context| | ||
next sampling_context[:parent_sampled] unless sampling_context[:parent_sampled].nil? | ||
|
||
rack_env = sampling_context[:env] | ||
rate_from_nginx = Float(rack_env["HTTP_X_SENTRY_RATE"], exception: false) | ||
return rate_from_nginx if rate_from_nginx | ||
return 0.01 if Rails.env.production? | ||
return 1.00 if Rails.env.staging? | ||
|
||
# Default to off for other environments when no override is present | ||
0.0 | ||
end | ||
|
||
# enable profiling | ||
# this is relative to traces_sample_rate | ||
config.profiles_sample_rate = 1.0 | ||
|
||
config.environment = Rails.env | ||
config.release = ArchiveConfig.REVISION.to_s | ||
end | ||
end |
Oops, something went wrong.