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

additional tags for individual spans in fetch plugin #1287

Closed
1 task
nagarajatantry opened this issue Jul 7, 2020 · 2 comments · Fixed by #2071
Closed
1 task

additional tags for individual spans in fetch plugin #1287

nagarajatantry opened this issue Jul 7, 2020 · 2 comments · Fixed by #2071

Comments

@nagarajatantry
Copy link
Contributor

  • [ x] This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first
    I am trying out the fetch plugin. I would like to add additional tags on some of the spans on need basis.

For example, in the below code snippet, i was trying to add additional tags based on url endpoints.

const getData = (url) => fetch(url, {
  method: 'GET',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
});

Reference --> https://github.com/open-telemetry/opentelemetry-js/blob/master/examples/tracer-web/examples/fetch/index.js#L32-L38

@dyladan
Copy link
Member

dyladan commented Jul 7, 2020

I think you are looking for something similar to the http plugins's applyCustomAttributesOnSpan? https://github.com/open-telemetry/opentelemetry-js/blob/e93a86633bce5cc2ddeed4820adbcc5b60f88872/packages/opentelemetry-plugin-https/README.md#https-plugin-options

@obecny
Copy link
Member

obecny commented Jul 8, 2020

Can you please describe problem in more details as well as what would be the desired solution. Do you want to add static tags for each span or only some spans and if so how would you decide then which. Should those tags be static or dynamic (some callback needed for example) etc.

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

Successfully merging a pull request may close this issue.

3 participants