Skip to content

Fix Sentry log category filtering - #3725

Merged
martincostello merged 1 commit into
mainfrom
fix-sentry-logs
Nov 12, 2026
Merged

martincostello merged 1 commit into
mainfrom
fix-sentry-logs

Conversation

@martincostello

Copy link
Copy Markdown
Owner

Apply the Logging:Sentry:LogLevel rules to Sentry's breadcrumb/event logger provider by its type name, so that noisy log categories are filtered again.

Sentry 6.13.0 includes getsentry/sentry-dotnet#5872, which removed the Sentry alias from the breadcrumb/event logger providers. As a result, the existing Logging:Sentry:LogLevel rules now only apply to the structured logs provider, and log entries from the categories we filter are processed as breadcrumbs again. This adds allocations and CPU overhead to request processing: in a profiling comparison of another application before/after the upgrade, this showed up as ~10% more total allocations, offsetting the improvements from the upgrade.

The existing Logging:Sentry section is retained as it still applies to the structured logs provider. The new section is keyed on Sentry.AspNetCore.SentryAspNetCoreLoggerProvider (an internal Sentry type), which restores the previous filtering behaviour as the provider-specific rule takes precedence over the category-less rule that Sentry registers.

🤖 Generated with Claude Code

Sentry 6.13.0 stopped applying the `Logging:Sentry:LogLevel` rules to its
breadcrumb/event logger provider (getsentry/sentry-dotnet#5872), so log
entries from categories such as `Microsoft` and `System` were being
processed as breadcrumbs again.

Apply the same rules to the provider using its type name so they continue
to be respected.

Assisted-by: Claude Code <noreply@anthropic.com>
@martincostello
martincostello marked this pull request as ready for review November 12, 2026 11:07
Copilot AI balanced review requested due to automatic review settings November 12, 2026 11:07
@martincostello
martincostello enabled auto-merge (squash) November 12, 2026 11:07
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@martincostello
martincostello merged commit 1d19d78 into main Nov 12, 2026
16 checks passed
@martincostello
martincostello deleted the fix-sentry-logs branch November 12, 2026 11:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the provider-specific Sentry filtering change.

No open issues 🎉

What changed in this PR

Restores Sentry breadcrumb/event category filtering after Sentry 6.13.0 removed the provider’s Sentry alias, reducing unnecessary log processing.

Changes:

  • Adds the existing category thresholds under the fully qualified breadcrumb/event provider name.
  • Retains Logging:Sentry rules for the structured logs provider.
File Description
src/​API/​appsettings.json Adds provider-specific Sentry filtering for Microsoft, Data Protection, and System log categories.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants