-
I'm still puzzled how to configure the autoinstrumentation such that my pre-configured headers appear as span attributes. This is my configuration Instrumentation: apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: otel-instrumentation
spec:
exporter:
endpoint: http://opentelemetry-collector.telemetry.svc.cluster.local:4318
propagators:
- tracecontext
- baggage
sampler:
type: parentbased_traceidratio
argument: "1"
java:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:2.8.0
env:
- name: OTEL_JAVAAGENT_DEBUG
value: "true"
- name: OTEL_METRICS_EXPORTER
value: none
- name: OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS
value: "x-business-user" When performing this against the application, my client header (x-business-user) is not emitted: This is the application log: Java 21 What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You are using the flag that captures headers for a http client, but expecting to see the header added to a server span. Try with the server flag, see https://opentelemetry.io/docs/zero-code/java/agent/instrumentation/http/#capturing-http-request-and-response-headers |
Beta Was this translation helpful? Give feedback.
You are using the flag that captures headers for a http client, but expecting to see the header added to a server span. Try with the server flag, see https://opentelemetry.io/docs/zero-code/java/agent/instrumentation/http/#capturing-http-request-and-response-headers