feat: Add option to exclude certain HTTP statuses from tracing #5034
1 issue
find-bugs: Found 1 issue (1 high)
High
TraceIgnoreStatusCodeTransactionProcessor will never filter transactions in ASP.NET Core - `src/Sentry/Internal/TraceIgnoreStatusCodeTransactionProcessor.cs:22-27`
The processor reads transaction.Data to find the HTTP status code, but this data is never populated when transactions come from ASP.NET Core. The SentryTracingMiddleware calls SetExtra/SetData on TransactionTracer._data, but when SentryTransaction is created from the tracer, it only copies Contexts.Trace.Data (which is a separate empty dictionary). The unit tests pass because they call SetData directly on SentryTransaction, bypassing the real code path.
Duration: 14m · Tokens: 5.8M in / 27.3k out · Cost: $6.35 (+extraction: $0.00)
Annotations
Check failure on line 27 in src/Sentry/Internal/TraceIgnoreStatusCodeTransactionProcessor.cs
sentry-warden / warden: find-bugs
TraceIgnoreStatusCodeTransactionProcessor will never filter transactions in ASP.NET Core
The processor reads `transaction.Data` to find the HTTP status code, but this data is never populated when transactions come from ASP.NET Core. The SentryTracingMiddleware calls `SetExtra`/`SetData` on `TransactionTracer._data`, but when `SentryTransaction` is created from the tracer, it only copies `Contexts.Trace.Data` (which is a separate empty dictionary). The unit tests pass because they call `SetData` directly on `SentryTransaction`, bypassing the real code path.