Skip to content

Blazor WebAssembly apps don't report a Blazor SDK name #5613

Description

@jamescrosswell

Problem Statement

Every Sentry .NET integration that initialises the SDK stamps its own SDK name on the events and logs it sends — except Blazor WebAssembly:

Package sdk.name Set in
Sentry sentry.dotnet Sentry/Internal/Constants.cs
Sentry.AspNetCore sentry.dotnet.aspnetcore SentryMiddleware
Sentry.AspNetCore.Grpc sentry.dotnet.aspnetcore.grpc SentryBuilderExtensions
Sentry.Maui sentry.dotnet.maui SentryMauiEventProcessor
Sentry.Google.Cloud.Functions sentry.dotnet.google-cloud-function SentryStartup
Sentry.AspNetCore.Blazor.WebAssembly — nothing

Sentry.AspNetCore.Blazor.WebAssembly does initialise the SDK (UseSentry → AddSentry<SentryBlazorOptions>), so by the rule in #5497 (comment) — the SDK name identifies the integration that initialised the hub — it should have a name of its own. It has no Constants class and sets nothing, so Blazor WebAssembly apps are indistinguishable from a plain SentrySdk.Init console app in Sentry.

Today on main this is masked rather than correct: Blazor registers the Microsoft.Extensions.Logging logger provider, which stamps sentry.dotnet.extensions.logging, so Blazor apps are currently reported as the logging integration. Once #5595 lands, the logging integrations no longer set the SDK name, and Blazor falls back to plain sentry.dotnet. Either way the SDK name doesn't identify Blazor.

Solution Brainstorm

  • Add an SDK name for the package (sentry.dotnet.aspnetcore.blazor.webassembly?) and set it the way the other integrations do: an event processor for events, plus its own SdkVersion on the structured logger provider, mirroring SentryAspNetCoreStructuredLoggerProvider and SentryMauiStructuredLoggerProvider.
  • Confirm whether a new SDK name needs an entry in the sentry-release-registry before it ships — the existing Constants files point at it. The NuGet package itself is already listed in .craft.yml's registry sdks map; what's unclear is whether the sdk.name value needs registering separately, and how product surfaces treat an unregistered name.
  • This is additive and not breaking, so it can land on main rather than waiting for v7.

Related: #5497, #5595

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeBugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions