Repository navigation
docs(dotnet): Fix the .NET logs and metrics examples and other pages for SDK 7.0.0 - #20781
Merged
ric-oliv merged 5 commits intoNov 13, 2026
Merged
Conversation
The .NET tabs used SentrySdk.Logger.Info(..., logger => logger.SetAttribute(...)) and SentrySdk.Metrics.Counter(...).Tag(...).Increment(), which don't exist in any SDK version. They now use LogInfo/LogWarning/LogError with a SentryLog callback, and EmitCounter/EmitGauge/EmitDistribution with an attributes dictionary. The development configuration no longer sets EnableLogs, which 7.0.0 removed from SentryOptions. Logs from SentrySdk.Logger are always sent. A string array attribute becomes "System.String[]", so changedKeys is a comma-separated string. Metrics drop decimal values, so the order amount is cast to double. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reStatusCodes The option's default badge said [] and "changes in 7.0.0". Since 7.0.0 the default is 301, 305-399 and 401-404. The appsettings.json paragraph also ended in a colon with no example after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re 2.3 setup Sentry.OpenTelemetry depends on OpenTelemetry 1.12.0, so pinning 1.5.0 fails to restore with NU1605. Sentry.AspNetCore has targeted modern .NET only since 4.0, so the ASP.NET Core 2.3 on .NET Framework setup on the options page fails to restore with NU1202. Those apps use Sentry.AspNet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Azure Functions guide initializes Sentry with UseSentry from Sentry.Extensions.Hosting, but its options page fell back to the generic SentrySdk.Init example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
|
Please update the IS YOUR CHANGE URGENT? section of the PR description:
This information helps the Docs team prioritize your review. |
Contributor
|
Getting ready to monitor this change · Rollout details
|
…wording The .NET tab now shows Log<Level>, and .NET's method is LogWarning, not LogWarn. Other options on the site write their default notes as "since version X". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 of 8 tasks
ric-oliv
added a commit
that referenced
this pull request
Nov 15, 2026
## DESCRIBE YOUR PR This updates the .NET docs for sentry-dotnet 7.0.0, which has been on NuGet since 2026-11-12. Each change was reviewed in its own PR against the `dotnet-v7` branch, so the 7.x docs go live together: - #20311 docs(dotnet): Add a Generic Host guide for SDK 7.0.0 - #20642 docs(dotnet): Add supported versions to the MAUI guide for SDK 7.0.0 - #19960 docs(dotnet): Document release and environment resolution for SDK 7.0.0 - #19961 docs(dotnet): Update Microsoft.Extensions.Logging guide for SDK 7.0.0 - #19924 docs(dotnet): Update OTLP propagation docs for SDK 7.0.0 - #19925 docs(dotnet): Update logging docs for SDK 7.0.0 - #20715 docs(dotnet): Document ClearProviders() in the ASP.NET Core guide for SDK 7.0.0 - #20752 docs(dotnet): Tell .NET Framework apps to install Microsoft.Extensions.Logging for SDK 7.0.0 - #20743 docs(dotnet): Document NLog's MinimumLogLevel for SDK 7.0.0 - #20742 docs(dotnet): Link the Generic Host guide from the other .NET pages for SDK 7.0.0 - #20689 docs(dotnet): Update the 7.x migration guide for 7.0.0 - #20780 docs(dotnet): Fix Serilog flushing, Serilog usings and the Azure Functions package for SDK 7.0.0 - #20781 docs(dotnet): Fix the .NET logs and metrics examples and other pages for SDK 7.0.0 ### Issues this closes Closes getsentry/sentry-dotnet#5710 The other docs issues for 7.0.0 were closed when their PRs merged into `dotnet-v7`. ### Before merging - [x] sentry-dotnet 7.0.0 is on NuGet. - [x] The release candidate alert is gone from `includes/dotnet-v7-migration-overview.mdx`. - [x] The links that #20311, #19961 and #19925 left for after the other PRs merge are in. - [x] `master` is merged into `dotnet-v7`, and the Vercel preview looks right. - [x] This description has a `Closes` line for every issue that's still open. ## 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-11-13 - [ ] Other deadline: YYYY-MM-DD - [ ] No deadline: Not urgent, can wait up to 1 week+ --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com> Co-authored-by: ric-oliv <ric-oliv@users.noreply.github.com> Co-authored-by: ric-oliv <5938598+ric-oliv@users.noreply.github.com> Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
This branch was successfully deployed
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.
DESCRIBE YOUR PR
More .NET fixes from reviewing #20641 against the 7.0.0 packages. These pages aren't part of #20641's diff, but they're wrong for 7.0.0 users. Each fix is its own commit.
get-started/guidesusedSentrySdk.Logger.Info(..., logger => ...)andSentrySdk.Metrics.Counter(...).Tag(...).Increment(). Neither API exists in any SDK version. The tabs now useLogInfo,LogWarningandLogErrorwith aSentryLogcallback, andEmitCounter,EmitGaugeandEmitDistributionwith an attributes dictionary. The development configuration also dropsEnableLogs, which 7.0.0 removed fromSentryOptions.TraceIgnoreStatusCodesshowed[]as its default. Since 7.0.0 the default is 301, 305 to 399 and 401 to 404. Itsappsettings.jsonparagraph ended in a colon with no example, so I added one.OpenTelemetry1.5.0 or higher.Sentry.OpenTelemetrydepends on 1.12.0, so 1.5.0 fails to restore with NU1605.Sentry.AspNetCorehas targeted modern .NET only since 4.0, so that setup fails to restore with NU1202.SentrySdk.Initexample, while the guide usesUseSentry. It now has its ownUseSentryexample.Every changed snippet compiles against the 7.0.0 packages. I also ran the logs and metrics examples and checked that their attributes reach Sentry. That's why
changedKeysis now a comma-separated string, since a string array arrives asSystem.String[]. The order amount is cast todouble, because metrics dropdecimalvalues.It targets
dotnet-v7, so it goes live with the rest of the 7.0.0 docs in #20641.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-DDwith the due date. You can update this information later by editing the PR description.SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
EXTRA RESOURCES