Skip to content

Capture http request headers on spans #1975

Open
@diecgia

Description

@diecgia

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions