nginxinc/nginx-otel

Add opentelemetry_ignore_paths directive to the module

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe

I would like to exclude certain paths from creating spans. These calls are made to nginx internally using the vts module, and do not have strict location blocks for these paths:

/{status_uri}/format/json
/{status_uri}/control?cmd=status&...

Describe the solution you'd like

Implement the opentelemetry_ignore_paths directive as supported by the upstream otel_ngx module

Describe alternatives you've considered

Because the calls mentioned above do not have strict location blocks, I cannot use the otel_trace off; option to suppress span creation.

Additional context

I'm happy to use other alternatives as suggested by the team if they exist.

In general, paths can be ignored via map as otel_trace supports variables, e.g.

http {
    map $uri $traceable {
        ~^/status off;
        default on;
    }

    otel_trace $traceable;

Also, what do you mean by "strict location blocks"? Can't you just put otel_trace off; to the same location as vhost_traffic_status_display;?