sentry: trace requests that answer 303
sentry-ruby drops a transaction that answers 303 by default, and every admin write answers one,
so no upload, no Save, and no other form post had ever been traced, since none was in its run.
Web now names that default less 303, and config.ru hands Sentry the list it should skip;
301 and the 404s stay dropped, the DAV redirect and the probes being noise, not the trip.
Assisted-by: Claude Opus 5.5 via Claude Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/config.ru b/config.ru
index 5d7615c..6a57ea8 100644
--- a/config.ru
+++ b/config.ru
@@ -48,6 +48,7 @@ Sentry.init do |sentry|
sentry.exclude_loggers = [ProTacts::ExchangeLog::PROGNAME]
sentry.traces_sample_rate = 1.0
+ sentry.trace_ignore_status_codes = ProTacts::Web::UNTRACED_STATUSES
end
ProTacts::Web.plugin :common_logger, $stderr
diff --git a/lib/pro_tacts/web.rb b/lib/pro_tacts/web.rb
index 50a2f32..ed55876 100644
--- a/lib/pro_tacts/web.rb
+++ b/lib/pro_tacts/web.rb
@@ -30,6 +30,11 @@ module ProTacts
__dir__ #: String
).parent.parent / "public" #: Pathname
+ # The statuses whose transactions Sentry drops, for config.ru:
+ # sentry-ruby's default (TRACE_IGNORE_STATUS_CODES_DEFAULT) less 303,
+ # which answers every admin write, so an upload or a Save is traced.
+ UNTRACED_STATUSES = [(301..302), (305..399), (401..404)].freeze #: Array[Range[Integer]]
+
# The store this app serves from. config.ru builds it and hands it in;
# nothing here reaches for a global to find one, which is what lets a
# test point the app at a throwaway database. Kept in Roda's own opts