Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider 1st class support for SignalR tracing #1998

Open
BrennanConroy opened this issue Aug 7, 2024 · 1 comment · May be fixed by #2429
Open

Consider 1st class support for SignalR tracing #1998

BrennanConroy opened this issue Aug 7, 2024 · 1 comment · May be fixed by #2429
Labels
comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore enhancement New feature or request

Comments

@BrennanConroy
Copy link

Component

OpenTelemetry.Instrumentation.AspNetCore

Is your feature request related to a problem?

In .NET 9, SignalR has added telemetry support which uses the name "Microsoft.AspNetCore.SignalR.Server" on the server-side and "Microsoft.AspNetCore.SignalR.Client" on the client-side. It would be nice if AddAspNetCoreInstrumentation could enable the server-side tracing as SignalR is part of ASP.NET Core.

What is the expected behavior?

Calling tracing.AddAspNetCoreInstrumentation(); sets up SignalR (at least server-side) tracing.

Right now you would need to call tracing.AddSource("Microsoft.AspNetCore.SignalR.Server");. It also looks like there is more logic based on specific activity names

internal const string ActivityOperationName = "Microsoft.AspNetCore.Hosting.HttpRequestIn";

Not sure what exactly is done there but there might be more work to be done for listening to SignalR activites too.

Which alternative solutions or features have you considered?

Alternatively, there could be a new AddSignalRInstrumentation() similar to other libraries like AddGrpcCoreInstrumentation().

For the client-side, there might also want to be a separate method for it similar to AddHttpClientInstrumentation.

Additional context

dotnet/aspnetcore#51557 tracks the ASP.NET Core side for SignalR instrumentation and includes cross-linking to relevant PRs and other information.

@BrennanConroy BrennanConroy added the enhancement New feature or request label Aug 7, 2024
@github-actions github-actions bot added the comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore label Aug 7, 2024
@JamesNK
Copy link

JamesNK commented Aug 8, 2024

Implementing AddSignalRInstrumentation() might be as simple as calling builder.AddActivitySource("Microsoft.AspNetCore.SignalR.Server") internally.

It would only be supported in .NET 9 and later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.aspnetcore Things related to OpenTelemetry.Instrumentation.AspNetCore enhancement New feature or request
Projects
None yet
2 participants