Skip to content

Commit

Permalink
Merge pull request #489 from photonia-io/reduce-sentry-sampling
Browse files Browse the repository at this point in the history
Reduce Sentry sampling rate
  • Loading branch information
janosrusiczki authored Apr 10, 2023
2 parents 1c7178d + 8675f86 commit f332edc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def set_configuration_json
users_sign_in_path:,
users_sign_out_path:,
users_settings_path:,
sentry_dsn: ENV.fetch('PHOTONIA_FE_SENTRY_DSN', '')
sentry_dsn: ENV.fetch('PHOTONIA_FE_SENTRY_DSN', ''),
sentry_sample_rate: ENV.fetch('PHOTONIA_FE_SENTRY_SAMPLE_RATE', 0.1).to_f
)
).serializable_hash.to_json
end
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/entrypoints/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.5,
tracesSampleRate: cjda.sentry_sample_rate
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/serializers/configuration_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
class ConfigurationSerializer
include JSONAPI::Serializer
attributes :root_path, :graphql_url, :photos_path, :albums_path, :tags_path, :users_sign_in_path,
:users_sign_out_path, :users_settings_path, :sentry_dsn
:users_sign_out_path, :users_settings_path, :sentry_dsn, :sentry_sample_rate
end
2 changes: 1 addition & 1 deletion config/initializers/sentry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# 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
config.traces_sample_rate = ENV.fetch('PHOTONIA_BE_SENTRY_SAMPLE_RATE', 0.1).to_f

# or
# config.traces_sampler = lambda do |context|
Expand Down

0 comments on commit f332edc

Please sign in to comment.