Skip to content
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

Overriding default tags #130

Open
paddycarey opened this issue May 28, 2020 · 0 comments
Open

Overriding default tags #130

paddycarey opened this issue May 28, 2020 · 0 comments

Comments

@paddycarey
Copy link

I'm trying to override some of the default tags that nginx-opentracing sets using opentracing_tag directives in my location blocks but it doesn't seem to work, is that expected?

I'm running:

Nginx: 1.13.6 (compiled from source)
OS: Ubuntu 16.04
nginx-opentracing: 0.9.0 (binary release)

The location blocks in my config look like so:

  location / {
    <irrelevant config redacted...>

    opentracing_operation_name "$request_method $uri";
    opentracing_tag "resource.name" "/";

    opentracing_tag "http.host" "$client_host";
    opentracing_tag "http.url" "$scheme://$client_host$uri";

    proxy_pass http://upstream;
  }

But when the span is sent I always see the default http.host and http.url tags as defined in the source here: https://github.com/opentracing-contrib/nginx-opentracing/blob/master/opentracing/src/ngx_http_opentracing_module.cpp#L49-L56

If I modify the config to use different tag names then (as below) then they come through fine, but ideally I'd like to use http.host and http.url to allow better consistency between my services.

  location / {
    <irrelevant config redacted...>

    opentracing_operation_name "$request_method $uri";
    opentracing_tag "resource.name" "/";

    opentracing_tag "http.client_host" "$client_host";
    opentracing_tag "http.client_url" "$scheme://$client_host$uri";

    proxy_pass http://upstream;
  }

Is there anything I can do to make this work currently? If not, does this seem like something that's worth a PR to change the behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant