jaegertracing / jaeger-client-csharp

🛑 This library is DEPRECATED!
https://jaegertracing.io/
Apache License 2.0
302 stars 67 forks source link

Any option to ignore request pattern? #155

Closed xumix closed 4 years ago

xumix commented 5 years ago

Hi. Is there any way to configure client so that it would not report some incoming/outgoing requests? For example health checks or some service calls. Something like this:

services.Configure<HttpHandlerDiagnosticOptions>(options =>
            {
                options.IgnorePatterns.Add(x => !x.RequestUri.IsLoopback);
            });
Falco20019 commented 5 years ago

It depends on what environment you are using. It sound's like you want to use ASP.NET Core. In this case, you might want to use opentracing-contrib/csharp-netcore.

There is an example on how to add ignores here: https://github.com/opentracing-contrib/csharp-netcore/blob/master/samples/Shared/JaegerServiceCollectionExtensions.cs

Falco20019 commented 4 years ago

@xumix Is this resolved with my answer? If yes, please close the ticket. Thanks :)

xumix commented 4 years ago

@xumix Is this resolved with my answer? If yes, please close the ticket. Thanks :)

Thanks! Looks like at the moment of opening the ticket there were no such option.

AntonyNET commented 4 years ago

@xumix Is this resolved with my answer? If yes, please close the ticket. Thanks :)

Thanks! Looks like at the moment of opening the ticket there were no such option.

Try this. It is work for me to filter incoming requests.

services.Configure<AspNetCoreDiagnosticOptions>(options =>
            {
                options.Hosting.IgnorePatterns.Add(context=> context.Request.Path.Value.EndWith("api/status");
            });

To filter ougoing requests u can use code from your first message.