You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using opentracing-csharp-netcore in an ASP.NET Core (3.1) application that receives SignalR requests via WebSockets.
In my Startup.ConfigureServices() method I setup OpenTracing as follows:
services.AddOpenTracingCoreServices(otBuilder =>{otBuilder.AddAspNetCore().ConfigureAspNetCore(options =>{varignoredRequestPaths=tracingOptions.IgnoredRequestPaths;options.Hosting.IgnorePatterns.Add(ctx =>(ignoredRequestPaths!=null)?ignoredRequestPaths.Contains(ctx.Request.Path):false);// options.Hosting.OnError = (span, exception, context) => {} -- this is only thrown when there is an unhandled exception, not when an HTTP error is purposefully returned by a controller// This sets the main-level Span Operation Name which normally has a less than useful value in my experience.options.Hosting.OperationNameResolver=(httpContext)=>{returnhttpContext.Request.Path.Value;};}).AddCoreFx().AddEntityFrameworkCore().AddLoggerProvider();});
Unfortunately, what I am finding is that SignalR via WebSockets requests received do not cause a Span to be created. Meanwhile, regular HTTP web requests work fine.
Is there some limitation to DiagnosticListeners that don't support SignalR over Web Sockets or does opentracing-csharp-netcore just not support listening for Web Socket events?
Sorry I am not an expert in the terminology for SignalR over Web Sockets or the inner workings of opentracing-charp-netcore but hopefully I got my question across despite that.
The text was updated successfully, but these errors were encountered:
Hi. I don't have any experience with SignalR so I don't know if & how it can be instrumented. Could you point me to some instrumentaion-code in the SignalR code?
I've done some quick research as well and I've seen that they introduced "Hub filters" with ASP.NET Core 5.0. This seems to be the same concept as "action filters" for MVC and gives you a nice hook.
So, if you're on ASP.NET Core 5.0, you could write a global hub filter that creates OpenTracing spans via the regular OpenTracing API.
I'm using opentracing-csharp-netcore in an ASP.NET Core (3.1) application that receives SignalR requests via WebSockets.
In my
Startup.ConfigureServices()
method I setup OpenTracing as follows:Unfortunately, what I am finding is that SignalR via WebSockets requests received do not cause a Span to be created. Meanwhile, regular HTTP web requests work fine.
Is there some limitation to DiagnosticListeners that don't support SignalR over Web Sockets or does opentracing-csharp-netcore just not support listening for Web Socket events?
Sorry I am not an expert in the terminology for SignalR over Web Sockets or the inner workings of opentracing-charp-netcore but hopefully I got my question across despite that.
The text was updated successfully, but these errors were encountered: