Consider 1st class support for SignalR tracing #1998
Labels
comp:instrumentation.aspnetcore
Things related to OpenTelemetry.Instrumentation.AspNetCore
enhancement
New feature or request
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 ifAddAspNetCoreInstrumentation
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 namesopentelemetry-dotnet-contrib/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs
Line 21 in 88645a9
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 likeAddGrpcCoreInstrumentation()
.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.
The text was updated successfully, but these errors were encountered: