Skip to content

Baggage header not propagated on outgoing WebClient (Reactor Netty) requests #11510

Description

@ls-adrian-chong

Summary

dd-trace-java does not inject the W3C baggage header on outgoing HTTP requests made via Spring WebClient (Reactor Netty transport). Trace headers (traceparent, x-datadog-*) are injected correctly, but baggage is consistently missing.

Environment

  • dd-java-agent: 1.62.0
  • Java: 17 and 25 (Amazon Corretto) — tested both, same result
  • Spring Boot: 3.4.13 and 3.5.14 — tested both, same result
  • Reactor Netty: 1.2.6 and 1.2.17 — tested both, same result

Configuration

DD_TRACE_PROPAGATION_STYLE=tracecontext,baggage,datadog
DD_TRACE_INTEGRATION_REACTOR_HOOKS_ENABLED=true
OTEL_PROPAGATORS=tracecontext,baggage

Also tried via JVM properties:

-Ddd.trace.propagation.style.extract=tracecontext,baggage,datadog
-Ddd.trace.propagation.style.inject=tracecontext,baggage,datadog
-Ddd.trace.integration.reactor-hooks.enabled=true

Reproduction

Minimal Spring Boot app with a single endpoint that receives a baggage header and proxies via WebClient:

@GetMapping("/proxy-netty")
public String proxyNetty() {
    return WebClient.builder().build()
        .get()
        .uri("http://localhost:9090/downstream")
        .retrieve()
        .bodyToMono(String.class)
        .block();
}

Steps:

  1. Start an echo server on port 9090 (prints received headers)
  2. Start the app with dd-java-agent attached
  3. Send: curl -H "baggage: userId=12345,sessionId=abc" http://localhost:8080/proxy-netty
  4. Observe echo server output

Expected: Echo server receives baggage: userId=12345,sessionId=abc
Actual: Echo server receives traceparent and x-datadog-* headers but no baggage

Notes

  • The same baggage header IS propagated correctly when using RestClient with JdkClientHttpRequestFactory or raw java.net.http.HttpClient.
  • This suggests the issue is specific to the Reactor Netty instrumentation path.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions