Repository navigation
Document TraceIgnoreStatusCodes and its new default for v7.0.0 #5708
Description
#5632 changed the default of SentryOptions.TraceIgnoreStatusCodes in 7.0.0 from an empty list to [301, (305, 399), (401, 404)]. The option itself shipped in 6.x (#5034), but the .NET docs don't mention it anywhere. In getsentry/sentry-docs, only the Go SDK documents it.
Apps that don't set the option will stop sending transactions for requests that end in those status codes. Users need a page that tells them why, and how to get those transactions back.
The .NET docs aren't versioned. The new default should be described as applying from 7.0.0 on, or the PR should merge when 7.0.0 ships.
What to document
Add an SdkOption entry to docs/platforms/dotnet/common/configuration/options.mdx, with the tracing options:
- ASP.NET Core and ASP.NET don't send a transaction for an incoming request whose response status is in the list. That includes ASP.NET Core apps instrumented with OpenTelemetry. Only
http.servertransactions are affected, so outgoingHttpClientcalls are still traced (fix: TraceIgnoreStatusCodes no longer drops outgoing HTTP requests traced with OpenTelemetry #5643). - Entries are single status codes or ranges, as
intorHttpStatusCode:options.TraceIgnoreStatusCodes = [404, (500, 599)]; - From 7.0.0 the default is 301, 305–399 and 401–404. That's the SDK spec's recommended default minus 302 and 303, because ASP.NET Core apps use 302 to redirect after a successful form post (MVC
RedirectToAction, Razor PagesRedirectToPage, minimal APIsResults.Redirect, the Identity login). The cost is that cookie-auth challenges are still traced. - To trace every request again, call
options.TraceIgnoreStatusCodes.Clear();. - In
appsettings.json,"TraceIgnoreStatusCodes": [404]replaces the default.[]does not clear it, because configuration binds an empty array asnull; use[0]instead. Configuration can't express ranges yet (Support status code ranges when configuring TraceIgnoreStatusCodes from appsettings.json #5644).
Also mention the option in the tracing sections of the ASP.NET Core and ASP.NET guides. That's where users will look when the transactions for their 404s disappear.
The "Migration" section of #5632 is written so it can be copied into the 7.x migration guide (#5710).
Activity
linear-code commentedon Oct 12, 2026
NET-858
docs(dotnet): Document TraceIgnoreStatusCodes (#19898)