Support W3C baggage propagation across various async instrumentation#12033
Support W3C baggage propagation across various async instrumentation#12033mcculls wants to merge 3 commits into
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 084bff0 | Docs | Datadog PR Page | Give us feedback! |
ee589a5 to
59d706b
Compare
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR updates async instrumentation and bootstrap concurrency helpers to propagate the full Datadog Context (including W3C baggage) across asynchronous boundaries, instead of propagating only the active span.
Changes:
- Switch multiple async instrumentations from
activeSpan()-based capture tocurrentContext()/Context-based capture and continuation storage. - Update bootstrap concurrency helpers (
State,ConcurrentState,ExecutorInstrumentationUtils) to capture/propagateContextcontinuations (including contexts without spans when async propagation is enabled). - Adjust bootstrap startup timing to install the legacy context manager earlier, and add Graal native-image build-time initialization for
ContextProviders$ProvidedManager.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dd-java-agent/instrumentation/spring/spring-rabbit-1.5/.../DeliveryInstrumentation.java | Capture Context instead of AgentSpan when attaching async State to deliveries. |
| dd-java-agent/instrumentation/scala/scala-promise/.../PromiseHelper.java | Activate/capture async state using Context continuations (for baggage propagation). |
| dd-java-agent/instrumentation/java/java-concurrent/.../CompletableFutureAdvice.java | Capture Context into ConcurrentState for CompletableFuture completions. |
| dd-java-agent/instrumentation/java/java-concurrent/.../ConsumerTaskInstrumentation.java | Capture Context into State for fork/join consumer tasks. |
| dd-java-agent/instrumentation/java/java-concurrent/.../JavaExecutorInstrumentation.java | Use Context in executor task wrapping/state setup decisions. |
| dd-java-agent/instrumentation/guava-10.0/.../ListenableFutureInstrumentation.java | Use Context in listener wrapping/state setup decisions for Guava futures. |
| dd-java-agent/instrumentation/graal/.../NativeImageGeneratorRunnerInstrumentation.java | Ensure ContextProviders$ProvidedManager is initialized at build time for native-image. |
| dd-java-agent/agent-bootstrap/.../java/concurrent/State.java | Store/capture ContextContinuation from Context instead of from span capture. |
| dd-java-agent/agent-bootstrap/.../java/concurrent/ExecutorInstrumentationUtils.java | Update attach/setup logic to be Context-driven and allow no-span contexts. |
| dd-java-agent/agent-bootstrap/.../java/concurrent/ConcurrentState.java | Capture and hold Context continuations for completable-future-style state. |
| dd-java-agent/agent-bootstrap/.../Agent.java | Install legacy context manager earlier in bootstrap startup sequence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59d706b7fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
c775e0e to
28c6d46
Compare
28c6d46 to
0c04b99
Compare
0c04b99 to
084bff0
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Motivation
Propagates the full context, including W3C baggage, over various async calls.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]