From 143ab3dcbde5b77dd65ead6cbaa4aa83e6ea612d Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 19 May 2024 17:17:02 +0200 Subject: [PATCH] Add Sentry for real --- Gemfile | 3 ++- Gemfile.lock | 2 ++ config/initializers/sentry.rb | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 954f4cce..a49f6044 100644 --- a/Gemfile +++ b/Gemfile @@ -53,8 +53,9 @@ gem 'cancancan' gem 'httparty' # Glitchtip -gem 'sentry-rails' +gem 'stackprof' gem 'sentry-ruby' +gem 'sentry-rails' # Logging is awesome, and paper_trail even more gem 'paper_trail' diff --git a/Gemfile.lock b/Gemfile.lock index f1d996ad..7ea3ab00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -429,6 +429,7 @@ GEM net-scp (>= 1.1.2) net-sftp (>= 2.1.2) net-ssh (>= 2.8.0) + stackprof (0.2.26) stringio (3.1.0) strscan (3.1.0) thor (1.3.1) @@ -532,6 +533,7 @@ DEPENDENCIES simple_form simple_token_authentication spreadsheet + stackprof tinymce-rails turbolinks twitter-typeahead-rails diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 43198b82..965da73f 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,6 +1,18 @@ Sentry.init do |config| config.dsn = ENV["SENTRY_DSN"] config.breadcrumbs_logger = [:active_support_logger, :http_logger] - config.enabled_environments = %w[production] - config.debug = ENV.fetch("SENTRY_DEBUG", false) + + # 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 = 1.0 + # or + config.traces_sampler = lambda do |context| + true + end + + # Set profiles_sample_rate to profile 100% + # of sampled transactions. + # We recommend adjusting this value in production. + config.profiles_sample_rate = 1.0 end