-
Notifications
You must be signed in to change notification settings - Fork 293
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
Listen to SignalR server activities by default in ASP.NET Core #2429
base: main
Are you sure you want to change the base?
Listen to SignalR server activities by default in ASP.NET Core #2429
Conversation
if (Environment.Version.Major >= 9) | ||
{ | ||
// https://github.com/dotnet/aspnetcore/blob/6ae3ea387b20f6497b82897d613e9b8a6e31d69c/src/SignalR/server/Core/src/Internal/SignalRServerActivitySource.cs#L13C35-L13C70 | ||
builder.AddSource("Microsoft.AspNetCore.SignalR.Server"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these long (as in, really long) running server spans? I recall ApplicationInsights users complained about recording such long running spans, as that'd skew the latency calculations, and ended up ignoring those spans by default...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the case, then we should not do this by default, as there is no API to "remove" a source once added to the provider....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only long running span should be the http one that has the long running tag. All of the newly added SignalR spans are only for a specific operation.
Most of the spans added by SignalR add the long running span as a link, but individually they are short lived operations.
The OnConnectedAsync
and OnDisconnectedAsync
spans are the only 2 that are parented under the long running span, but they are both very short lived spans themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few years back, I collaborated with your team to introduce the http.long_running
attribute in SignalR to help filter long-running HTTP requests in Application Insights .NET SDK. This effort was driven by significant customer feedback about long-running SignalR requests distorting request duration metrics.
With http.long_running
part of the default ASP.NET Core instrumentation, customers might face similar issues if long-running spans are automatically included without a suppression mechanism. I recommend considering an option to filter these spans by default or providing a toggle to enable them explicitly before rolling this out.
Fixes #1998
Design discussion issue #1998
Changes
Adds activity source "Microsoft.AspNetCore.SignalR.Server" when calling
AddAspNetCoreInstrumentation
.This activity source is new in .NET 9.0.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes