opentelemetry-cpp-contrib icon indicating copy to clipboard operation
opentelemetry-cpp-contrib copied to clipboard

Add feature to ignore paths, such that no span is created for the specfifc paths matching the regex.

Open aryanishan1001 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Since spans for some requests might be unwanted, thus this feature is necessary.

Describe the solution you'd like Can be implemented by taking. imput from user about the paths they want to ignore, and not making spans for that call.

aryanishan1001 avatar Jan 22 '24 10:01 aryanishan1001

Isn't this already present ? https://github.com/open-telemetry/opentelemetry-cpp-contrib/blob/2a0db982f3d7ee91dfbe8150435e49e837bfb7ce/instrumentation/nginx/README.md?plain=1#L218

To ignore spans for common health endpoints:

opentelemetry_ignore_paths (?:livez?|readyz?|health(?:y|z)?|liveness|readiness|metrics|ping)$;

toredash avatar Jan 24 '24 07:01 toredash

@toredash I can't get 'opentelemetry_ignore_paths' to work.

I set opentelemetry_ignore_paths ^/fastly-probe$; in a location snippet, but still spans are created for the path /fastly-probe. Other variations like ^fastly-probe$ , ^/fastly-probe, fastly-probeetc. don't work either.

I am running ingress-nginx controller v0.10.0, which is compiled with --with-pcre-jit.

In the example above you use a proper regex, yet in the tests, a single string is used.

Can you help me out? Do you need further info?

norman-zon avatar Mar 07 '24 08:03 norman-zon

Putting opentelemetry_ignore_paths in a http block instead of location fixed it for me

norman-zon avatar Mar 07 '24 08:03 norman-zon

Putting opentelemetry_ignore_paths in a http block instead of location fixed it for me

Thats where I put it as well so figures why it didnt work :)

toredash avatar Mar 07 '24 14:03 toredash

This is for /instrumentation/otelwebservermodule.

DebajitDas avatar Mar 14 '24 06:03 DebajitDas

Ignore Path feature has been implemented in Otel-webserver-module Nginx

aryanishan1001 avatar Mar 19 '24 10:03 aryanishan1001