Skip to content

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

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

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

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 aws-java-sqs-1.0 when DSM is disabled:

  • Receive (TracingIterator): DataStreamsTags.create("sqs", INBOUND, queue) and a DataStreamsContext were built for every received message, only for a checkpoint that does nothing with DSM off.
  • Send (SqsInterceptor.newContext): the tags and context were built for every send, 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. SQS does the same create per message received and per send.

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: aws-java-sqs-1.0 test + forkedTest: 54 tests, 0 failures, including the DSM-enabled suites (SqsClientV0DataStreamsTest, receive-iteration).

Jira ticket: APMLP-2116

🤖 Generated with Claude Code

The receive iterator built DataStreamsTags and a DataStreamsContext for
every message, and the send interceptor built them for every send, even
with DSM disabled, where the checkpoint and DSM injection 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-prod-us1-5

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: 2cd8ad5 | 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.72 s 14.62 s [+0.1%; +1.3%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.54 s 13.61 s [-1.3%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.15 s 16.99 s [+0.1%; +1.8%] (maybe worse)
startup:petclinic:iast:Agent 16.96 s 17.16 s [-2.1%; -0.3%] (maybe better)
startup:petclinic:profiling:Agent 16.82 s 16.80 s [-0.9%; +1.1%] (no difference)
startup:petclinic:sca:Agent 17.18 s 16.98 s [+0.2%; +2.2%] (maybe worse)
startup:petclinic:tracing:Agent 16.24 s 16.29 s [-1.0%; +0.4%] (no difference)

Commit: 2cd8ad5e · 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:36
@dougqh
dougqh requested review from a team as code owners October 27, 2026 19:36
@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:39:06.011217Z 2cd8ad5 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-prod-us1-5 datadog-prod-us1-5 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 guards preserve span creation and tracing propagation when DSM is disabled, while retaining DSM context and checkpoint construction when enabled.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 2cd8ad5

@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:07 UTC ℹ️ Start processing command /merge


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

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


2026-10-27 22:24:26 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 0e7c5e8 into master Oct 27, 2026
634 of 646 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the dougqh/dsm-guard-sqs-1.0 branch October 27, 2026 22:24
@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: aws sdk AWS SDK 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