Skip to content

Improve OpenTelemetry instrumentation to support adding REST client headers to span for REST call #44307

Open
@svifred

Description

I would like to add attributes, specifically client request and response headers, to the OpenTelemetry span for each REST call. For the OpenTelemetry Java agent instrumentation, I would take advantage of the configuration parameters

otel.instrumentation.http.client.capture-request-headers
otel.instrumentation.http.client.capture-response-headers

but the Quarkus instrumentation does not provide an implementation of these.

Per @brunobat and the Q&A discussion #44256, it would be possible to add support for these config parameters:

Th implementation should be straight forward. We need to create the new properties to control the feature and add attributes to the span in this class:

public class OpenTelemetryClientFilter implements ClientRequestFilter, ClientResponseFilter {

and this one as well:

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions