Skip to content

Propagate W3C baggage through RabbitMQ clients and Spring listeners - #13861

Open
mcculls wants to merge 7 commits into
mcculls/kafka-baggage-propagationfrom
mcculls/rabbitmq-baggage-propagation
Open

mcculls wants to merge 7 commits into
mcculls/kafka-baggage-propagationfrom
mcculls/rabbitmq-baggage-propagation

Conversation

@mcculls

@mcculls mcculls commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Preserves W3C baggage in RabbitMQ consumer scopes, downstream publishes, and Spring Rabbit listener execution, including when Data Streams Monitoring is enabled.

Motivation

RabbitMQ dropped baggage when it reduced extracted context to a span. Spring Rabbit also lost baggage when switching from its resumed delivery continuation to the listener span. Messages could retain their trace IDs while losing baggage.

Additional Notes

Stacked on mcculls/kafka-baggage-propagation; this draft targets that branch. Reuses the existing baggage configuration and AMQP header representation.

Keeps the full context across both hand-offs and during injection. Retains the existing bounded polling-receive scope lifetime and respects disabled queues and exchanges.

Validation: complete RabbitMQ baseline/latest/Reactor suites and Spring Rabbit baseline/latest suites, including encoded baggage, downstream forwarding, handler failures, context restoration, DSM, and disabled-propagation regressions; Spotless checks passed.

@mcculls mcculls added type: bug fix Bug fix inst: rabbitmq RabbitMQ instrumentation inst: spring Spring instrumentation comp: context propagation Trace context propagation tag: ai generated Largely based on code generated by an AI or LLM labels Dec 5, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 60.42% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 825cc23 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.06 s 14.06 s [-0.6%; +0.7%] (no difference)
startup:insecure-bank:tracing:Agent 12.96 s 13.04 s [-1.4%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.30 s 17.17 s [-0.3%; +1.8%] (no difference)
startup:petclinic:iast:Agent 17.14 s 17.26 s [-1.6%; +0.1%] (no difference)
startup:petclinic:profiling:Agent 16.91 s 17.08 s [-2.5%; +0.4%] (no difference)
startup:petclinic:sca:Agent 17.26 s 15.81 s [+2.3%; +16.0%] (unstable)
startup:petclinic:tracing:Agent 16.35 s 16.32 s [-1.0%; +1.4%] (no difference)

Commit: 825cc237 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@mcculls
mcculls force-pushed the mcculls/kafka-baggage-propagation branch from 37de857 to 7f78ff1 Compare December 5, 2026 15:46
@pr-commenter

pr-commenter Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch mcculls/kafka-baggage-propagation mcculls/rabbitmq-baggage-propagation
git_commit_date 1796492525 1796564345
git_commit_sha d2e64ae 825cc23
See matching parameters
Baseline Candidate
ci_job_date 1796565412 1796565412
ci_job_id 2332673072 2332673072
ci_pipeline_id 157911731 157911731
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-1fpzhg84 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-1fpzhg84 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

@pr-commenter

pr-commenter Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch mcculls/kafka-baggage-propagation mcculls/rabbitmq-baggage-propagation
git_commit_date 1796492525 1796495783
git_commit_sha d2e64ae baa3cec
See matching parameters
Baseline Candidate
ci_job_date 1796496817 1796496817
ci_job_id 2332338509 2332338509
ci_pipeline_id 157877550 157877550
cpu_model Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-fz0auxxc 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-fz0auxxc 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

@mcculls mcculls added type: feature Enhancements and improvements and removed type: bug fix Bug fix inst: spring Spring instrumentation labels Dec 5, 2026
Keep the full extracted message context active during RabbitMQ receive
scopes and inject the current context when publishing, including when
Data Streams Monitoring is enabled.

Cover encoded baggage, downstream publishes, handler failures, context
restoration, and disabled queues and exchanges.
Carry the resumed delivery context into the listener span so baggage
survives Spring Rabbit's asynchronous hand-off and can propagate
downstream.

Add success and failure regressions for both context modes.
Use shared config constants, explicit conditional blocks, named
asynchronous timeouts, direct current-span access, and one shared no-
baggage consumer fixture.
@mcculls
mcculls force-pushed the mcculls/rabbitmq-baggage-propagation branch from f48e376 to d16e5ff Compare December 5, 2026 17:57
Remove the redundant consumer activation and its matching close. Cover
baggage-only publishing and queue timing under both context managers,
matching Kafka propagation behaviour.

Simplify test constants, imports, and assertions, and align baggage
suppression comments.
Move the root-context header test into the publish fixture and remove
the redundant tracing-disabled configuration from its direct advice
tests.
@mcculls
mcculls marked this pull request as ready for review December 5, 2026 18:33
@mcculls
mcculls requested review from a team as code owners December 5, 2026 18:33
@mcculls
mcculls requested review from cecile75 and jordan-wong and removed request for a team December 5, 2026 18:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T18:35:29.657214Z 54b94fd Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The completed static review found that RabbitMQ and Spring context hand-offs preserve baggage alongside their spans, including during DSM publish injection, with no actionable defect identified. No human PR discussion was present.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 54b94fd

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bits Code Review was unable to complete this review. View session

Please try again by commenting @datadog review.

@mcculls
mcculls force-pushed the mcculls/rabbitmq-baggage-propagation branch from baa3cec to 825cc23 Compare December 6, 2026 13:39

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The RabbitMQ and Spring hand-offs preserve baggage alongside span context, including during DSM injection. Static review identified no actionable defect.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 825cc23

This branch has not been deployed

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

Labels

comp: context propagation Trace context propagation inst: rabbitmq RabbitMQ instrumentation tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant