Skip to content

Skip DSM tag/context building in RabbitMQ when Data Streams is off (dsm - perf quick fix) - #13081

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
dougqh/dsm-guard-rabbitmq
Oct 27, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
dougqh/dsm-guard-rabbitmq

Conversation

@dougqh

@dougqh dougqh commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Skips building Data Streams Monitoring (DSM) tags and context in rabbitmq-amqp-2.7 when DSM is disabled:

  • Consume (RabbitDecorator): DataStreamsTags.create("rabbitmq", INBOUND, queue) and a DataStreamsContext were built for every delivery with headers, only for a checkpoint that does nothing with DSM off.
  • Publish (basicPublish advice): the tags and context were built for every publish, only to be ignored by the DSM propagator. With DSM off, the span alone is injected.

Both use the dynamic traceConfig().isDataStreamsEnabled() check, so turning DSM on through remote config still works.

Motivation

In the Kafka consumer, the same guard saved 548 B per record (−13.7% allocation) with DSM off (KafkaConsumeScenariosBenchmark, #13075), and +6.6% throughput in kafka-consumer-perf-test. Most of that is DataStreamsTags.create: prefixed tag strings, hashing, and a byte[] per hashed tag. RabbitMQ does the same create per delivery and per publish.

Additional Notes

Part of a sweep of the same pattern across messaging integrations, one PR per integration:

With DSM off at startup, the DSM propagator isn't registered, and DataStreamsPropagator.inject also returns early when isDataStreamsEnabled() is false. New spans get NoopPathwayContext, so setCheckpoint does nothing. The skipped work had no observable effect.

Follow-ups: APMLP-2116 (audit), APMLP-2117 (gated contributions, so a disabled product costs one branch by construction), APMLP-2147 (making DataStreamsTags cheap when DSM is on).

Tests: not run locally. The rabbitmq-amqp-2.7 tests need Docker (testcontainers), which wasn't available, so CI will be their first run. The module compiles.

Jira ticket: APMLP-2116

🤖 Generated with Claude Code

basicPublish built DataStreamsTags and a DataStreamsContext for every
publish, and the delivery decorator built them for every consumed
message, even with DSM disabled, where DSM injection and the checkpoint
are no-ops. Guard both with the dynamic isDataStreamsEnabled() check so
remote-config enablement still takes effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@datadog-datadog-prod-us1

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.82% (+9.34%)

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

@dd-octo-sts

dd-octo-sts Bot commented Oct 27, 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.04 s 13.97 s [-0.2%; +1.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.92 s 13.01 s [-1.4%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.20 s 16.43 s [-0.8%; +10.2%] (unstable)
startup:petclinic:iast:Agent 16.99 s 17.04 s [-1.2%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 16.78 s 17.01 s [-2.5%; -0.2%] (maybe better)
startup:petclinic:sca:Agent 17.12 s 16.98 s [-0.1%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 15.73 s 16.09 s [-6.5%; +1.9%] (no difference)

Commit: ef4718e4 · 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.

@dougqh
dougqh marked this pull request as ready for review October 27, 2026 19:37
@dougqh
dougqh requested review from a team as code owners October 27, 2026 19:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T19:40:15.636267Z ef4718e 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 datadog-datadog-prod-us1 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 DSM-disabled publish path still injects the tracing span, while DSM-enabled publish and consume paths preserve their existing behavior. The completed static review found no actionable regression.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit ef4718e

@ygree ygree 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.

IDM approved

@dougqh

dougqh commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-27 20:45:08 UTC ℹ️ Start processing command /merge


2026-10-27 20:45:12 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-10-27 21:57:25 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit e8c8320 into master Oct 27, 2026
634 of 643 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the dougqh/dsm-guard-rabbitmq branch October 27, 2026 21:57
@github-actions github-actions Bot added this to the 1.69.0 milestone Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: data streams Data Streams Monitoring inst: rabbitmq RabbitMQ instrumentation tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants