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

Support exporting custom header values in opentelemetry as span attributes #6362

Open
ad01bl opened this issue Jun 20, 2024 · 0 comments
Open

Comments

@ad01bl
Copy link

ad01bl commented Jun 20, 2024

Is your feature request related to a problem? Please describe.
There are some custom headers that we are sending to tyk api gateway such as ServiceHeader: <16characters> and similar ones. Right now when opentelemetry is enabled in tyk api gateway there are only some general headers exported to otel collector, in our case, Jaeger.
image

This is described here: https://tyk.io/docs/product-stack/tyk-gateway/advanced-configurations/distributed-tracing/open-telemetry/open-telemetry-overview/#common-http-span-attributes

Describe the solution you'd like
I would like to have option to enable sending custom header values as additional span attributes to otel collector instead of only some general ones. This could be done via env variable:
TYK_GW_OPENTELEMETRY_CAPTURE_HEADERS:"customheader1,customheader2"

You could follow the same way as it's implemented in python instrumentation, where you can specify which http request you want to capture:
https://opentelemetry.io/docs/languages/python/automatic/example/#capture-http-request-and-response-headers

Describe alternatives you've considered
I tried to override traceparent header with our custom headers, but the format of mentioned headers are different and can't be done this way

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

No branches or pull requests

1 participant