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

Capture http request headers on spans #1975

Open
diecgia opened this issue Mar 12, 2025 · 0 comments
Open

Capture http request headers on spans #1975

diecgia opened this issue Mar 12, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@diecgia
Copy link

diecgia commented Mar 12, 2025

Hi,
Currently, not all http headers are added to spans generated by otel-go. To determine the origin of the request, I want to add the "x-forwarded-for" http header to the spans.

I've seen that in java it is possible to add a property to capture the desired headers, for example, with the OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS env var: https://opentelemetry.io/docs/zero-code/java/agent/instrumentation/http/#capturing-http-request-and-response-headers

Would it be possible to enable these properties for go instrumentation or capture the "x-forwarded-for" header by default on the spans?

Thanks in advance!

@diecgia diecgia added the enhancement New feature or request label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant