Repository navigation
feat!: replace GetInternalSentryOptions with a GetDiagnosticLogger extension on IHub - #5862
Merged
Merged
Conversation
GetInternalSentryOptions was public only so Sentry.Hangfire, which isn't strong-named and so can't see Sentry's internals, could read the diagnostic logger. Replace it with a narrow, documented GetDiagnosticLogger extension in Sentry.Extensibility and remove the Obsolete-marked method. The Hangfire server filter now resolves the logger when it logs instead of once in its constructor, so it still logs when UseSentry() runs before SentrySdk.Init. Closes #4641 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## version7 #5862 +/- ##
============================================
- Coverage 76.76% 76.65% -0.12%
============================================
Files 539 540 +1
Lines 19694 19798 +104
Branches 3851 3886 +35
============================================
+ Hits 15119 15177 +58
- Misses 3703 3748 +45
- Partials 872 873 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv
approved these changes
Nov 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 6 tasks
27 tasks done
ric-oliv
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Nov 13, 2026
## DESCRIBE YOUR PR This gets the 6.x to 7.x migration guide for the Sentry SDK for .NET ready for 7.0.0, following #20143. It targets `dotnet-v7`, so it goes live with the rest of the 7.0.0 docs in #20641. - Removes the release candidate alert. Its note about restore error NU1605 still applies to .NET 11 apps on 7.0.0, so it moves to "Supported .NET Versions and Platforms". - Adds "Category Log Levels No Longer Filter Breadcrumbs and Events", for getsentry/sentry-dotnet#5869. Entries under `Logging:Sentry:LogLevel` now only filter logs, so an app that silenced a category gets that category's breadcrumbs and events. The section shows `AddLogEntryFilter` for apps that want the old filtering. - Adds `GetInternalSentryOptions` to "Other Removed and Internal APIs", for getsentry/sentry-dotnet#5862, and points to the new `GetDiagnosticLogger()` extension on `IHub`. - Links the Generic Host guide from #20311 and the MAUI guide's supported versions from #20642, which are both on `dotnet-v7`. These two SDK PRs are the only changes merged on `version7` since 7.0.0-rc.3 that affect people upgrading from 6.x. Two things depend on how 7.0.0 ships: - The NU1605 note assumes the `net11.0` builds depend on the stable .NET 11 packages. On `version7` today, they depend on .NET 11 RC 3. - The `LogLevel` fix also landed on 6.x in getsentry/sentry-dotnet#5872, which isn't released yet. The section says "6.12.1 and earlier", so it stays correct whether or not a 6.x release ships first. Refs getsentry/sentry-dotnet#5710 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [x] Urgent deadline (GA date, etc.): 2026-10-10 - [ ] Other deadline: YYYY-MM-DD - [ ] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com> Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SentryClientExtensions.GetInternalSentryOptionswas public only becauseSentry.Hangfireisn't strong-named (#4099), so it can't see Sentry's internals, and it needed the diagnostic logger. It was marked[Obsolete]to discourage anyone else from using it, which misuses the attribute (see the discussion on #4619).This removes it and adds what Hangfire actually needs, as a real public API:
Any integration that can't use
InternalsVisibleTohas the same need, third-party ones included, so this is a legitimate API rather than a "pubternal" one. It lives inSentry.ExtensibilitywithHubAdapterandIDiagnosticLogger, so app code that doesn't import that namespace won't see it.Breaking:
GetInternalSentryOptionsis removed. Nothing in getsentry/sentry-unity calls it.Changelog Entry
GetInternalSentryOptions, which was only meant for Sentry's own integrations. Integrations that need the SDK's diagnostic logger can call the newGetDiagnosticLogger()extension onIHub, inSentry.Extensibility.Notes for review
IHub. A new interface member would break everyIHubimplementer (netstandard2.0has no default interface members), and aDiagnosticLoggernext to the existingIHub.Logger(structured logs) would be easy to confuse. The trade-off: a customIHubgetsnull, which is whatGetInternalSentryOptionsreturned for one too.SentryServerFilternow looks up the logger each time it logs instead of once in its constructor. Before, ifUseSentry()ran beforeSentrySdk.Init,HubAdapterreturned no options and the filter never logged.ApiApprovalTests.Run.Net4_8.verified.txtwas edited by hand (it can't be regenerated on macOS), to match the other TFMs.Closes #4641
🤖 Generated with Claude Code