From 68425929c6cc565ddcd1982970d48be369deafaa Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 24 Feb 2021 17:45:18 +0100 Subject: [PATCH] config: disable Sentry sampling when not enabled This removes spam in the debug console when running locally. Removed messages look like a swarm of: > [Tracing] Discarding transaction because it's not included in the random sample (sampling rate = 0.001) --- config/initializers/sentry.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index a65106b50..2d4008a4f 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -3,5 +3,5 @@ Sentry.init do |config| config.send_default_pii = false config.enabled_environments = ['production'] config.breadcrumbs_logger = [:active_support_logger] - config.traces_sample_rate = 0.001 + config.traces_sample_rate = ENV['SENTRY_ENABLED'] == 'enabled' ? 0.001 : nil end