From d5ef471814037f593a5791045e8368f2903c45df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Meny?= Date: Thu, 19 May 2022 17:33:46 +0100 Subject: [PATCH] Add Sentry instrumentation (#593) --- app/controllers/form_controller.rb | 2 ++ config/initializers/sentry.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index be15cc1b3..537c94701 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -4,6 +4,7 @@ class FormController < ApplicationController before_action :find_resource_by_named_id, except: %i[submit_form review] def submit_form + transaction = Sentry.start_transaction(op: "submit_form") if @case_log @page = @case_log.form.get_page(params[:case_log][:page]) responses_for_page = responses_for_page(@page) @@ -23,6 +24,7 @@ class FormController < ApplicationController else render_not_found end + transaction.finish end def check_answers diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 6b21533c7..9323a8ab7 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,5 +1,5 @@ Sentry.init do |config| config.breadcrumbs_logger = %i[active_support_logger http_logger] config.enabled_environments = %w[production staging] - config.traces_sample_rate = 0.5 + config.traces_sample_rate = 1 end