From e35c1223f4d97db371987b2f98bc7eb3c7ed9f72 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Mon, 8 Dec 2025 09:39:35 -0800 Subject: [PATCH] Sentry: error context and release tracking (#22) * Sentry: use KAMAL_VERSION for release tracking Kamal injects KAMAL_VERSION at container runtime with the git SHA, so no need to bake it into the Docker image via build args. * Sentry: serve as Rails error reporter Sentry receives errors from Rails.error.report and Active Job `retry_on/discard_on report: true`. Error context is provided by Rails.error.set_context in Fizzy's Authentication concern and ApplicationJob. --- saas/lib/fizzy/saas/engine.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/saas/lib/fizzy/saas/engine.rb b/saas/lib/fizzy/saas/engine.rb index ede0cbfcf..4da208a72 100644 --- a/saas/lib/fizzy/saas/engine.rb +++ b/saas/lib/fizzy/saas/engine.rb @@ -52,8 +52,11 @@ module Fizzy config.dsn = ENV["SENTRY_DSN"] config.breadcrumbs_logger = %i[ active_support_logger http_logger ] config.send_default_pii = false - config.release = ENV["GIT_REVISION"] + config.release = ENV["KAMAL_VERSION"] config.excluded_exceptions += [ "ActiveRecord::ConcurrentMigrationError" ] + + # Receive Rails.error.report and retry_on/discard_on report: true + config.rails.register_error_subscriber = true end end end