Skip to content

Document TraceIgnoreStatusCodes and its new default for v7.0.0 #5708

Closed
getsentry/sentry-docs
#19898

Description

@jamescrosswell

#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.server transactions are affected, so outgoing HttpClient calls are still traced (fix: TraceIgnoreStatusCodes no longer drops outgoing HTTP requests traced with OpenTelemetry #5643).
  • Entries are single status codes or ranges, as int or HttpStatusCode: 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 Pages RedirectToPage, minimal APIs Results.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 as null; 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

  1. added
    .NETPull requests that update .net code
    Next MajorChanges scheduled for the next Major release.
    on Oct 12, 2026
  2. linear-code commented on Oct 12, 2026

    @linear-code
  3. added a commit that references this issue on Oct 14, 2026
    519ac85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETPull requests that update .net codeDocsNext MajorChanges scheduled for the next Major release.Traces

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions