Skip to content

Compute the DSM base hash at startup - #12879

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
rey.abolofia/dsm-base-hash-at-startup
Oct 15, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
rey.abolofia/dsm-base-hash-at-startup

Conversation

@purple4reina

@purple4reina purple4reina commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

After each agent discovery attempt, if nothing has set the base hash yet, computes it without a container tags hash. So DSM pathway hashes include service and env even when the agent never sends Datadog-Container-Tags-Hash, or when /info is not up yet.

Motivation

#9282 removed the startup call that set the base hash. Since then BaseHash starts at 0 and is set only when the agent response carries Datadog-Container-Tags-Hash, or when Tomcat or Spring Boot adds a process tag. The Lambda extension never sends that header. So in Lambda, every Java producer gets the same pathway hash for a topic in every env, and DSM credits all their pathways to one arbitrary Java service. We saw this in the serverless e2e data-streams suite: four Java Lambda clients produced identical hashes in two different envs.

Additional Notes

  • The check runs at the end of doDiscovery, not only on a successful /info, because the Lambda extension's /info can come up after the tracer first calls it. Until then, pathway contexts are still created and propagated, so their hashes must already include service and env.
  • Discovery is serialized by discoverIfOutdated, so this does not race with the container tags hash path. If /info later returns a container tags hash, that path recalculates the base hash as before.
  • Discovery never runs on the application thread, and the container tags hash path already calls BaseHash.calc from it.
  • Not covered, as before with the container tags hash path: tags created before the first discovery attempt keep a base hash of 0. This includes the static ones built when their class loads (the DataStreamsContext HTTP edge tags and the gRPC server edge tags).
  • DBM: with DD_DBM_INJECT_SQL_BASE_HASH and process tag propagation enabled, DBM now gets a base hash from agents that send no container tags hash. If a container tags hash arrives later, the value changes once.

Jira ticket: APMSVLS-673

🤖 Generated with Claude Code

@purple4reina purple4reina added type: bug fix Bug fix tag: serverless Serverless support comp: data streams Data Streams Monitoring tag: ai generated Largely based on code generated by an AI or LLM labels Oct 14, 2026
@purple4reina
purple4reina marked this pull request as ready for review October 14, 2026 19:32
@purple4reina
purple4reina requested review from a team as code owners October 14, 2026 19:32
@purple4reina
purple4reina requested review from AlexeyKuznetsov-DD and removed request for a team October 14, 2026 19:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-14T19:37:47.667477Z 4fd5c4d 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-official datadog-official 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: FAIL

Startup recalculation can overwrite a concurrent agent container-hash update. Later discovery responses with the same header do not repair the stale base hash, leaving DSM pathways without the current container identity.

Open Bits AI session

🤖 Bits Code Review · Commit 4fd5c4d

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4fd5c4dd86

ℹ️ 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".

@datadog-official

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 14, 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 13.91 s 13.92 s [-0.8%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 12.77 s 12.93 s [-2.0%; -0.6%] (maybe better)
startup:petclinic:appsec:Agent 17.13 s 16.98 s [-0.2%; +2.0%] (no difference)
startup:petclinic:iast:Agent 16.90 s 17.13 s [-2.1%; -0.6%] (maybe better)
startup:petclinic:profiling:Agent 16.62 s 16.85 s [-2.5%; -0.3%] (maybe better)
startup:petclinic:sca:Agent 17.13 s 17.00 s [-0.4%; +1.8%] (no difference)
startup:petclinic:tracing:Agent 16.17 s 16.19 s [-1.0%; +0.7%] (no difference)

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

@purple4reina
purple4reina force-pushed the rey.abolofia/dsm-base-hash-at-startup branch 2 times, most recently from 6803329 to 3228225 Compare October 14, 2026 20:21

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

🙇🙇 Thanks for the fix Rey!

@purple4reina

Copy link
Copy Markdown
Contributor Author

Eventbridge Before

Without service and env in the hash, all java producers are being clumped under a single service.

Screenshot 2026-10-14 at 23 30 26

dashboard pipeline

Eventbridge After

With this fix, we're able to correctly attribute each pathway by upstream service.

Screenshot 2026-10-14 at 23 31 49

dashboard pipeline

Set the base hash after each agent discovery attempt, even if /info failed
or sent no container tags hash, so DSM pathway hashes include service and env
with agents such as the Lambda extension.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@purple4reina
purple4reina force-pushed the rey.abolofia/dsm-base-hash-at-startup branch from ffe6097 to 1bfedbd Compare October 15, 2026 06:45
@purple4reina
purple4reina added this pull request to the merge queue Oct 15, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-15 19:11:29 UTC ℹ️ Start processing command /merge


2026-10-15 19:11:33 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-10-15 20:19:07 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 15, 2026
@purple4reina
purple4reina added this pull request to the merge queue Oct 15, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-15 19:12:41 UTC ℹ️ Start processing command /merge


2026-10-15 19:12:44 UTC ❌ MergeQueue

PR already in the queue with status in_progress

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 15, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 0b9173a into master Oct 15, 2026
611 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the rey.abolofia/dsm-base-hash-at-startup branch October 15, 2026 20:19
@github-actions github-actions Bot added this to the 1.68.0 milestone Oct 15, 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 tag: ai generated Largely based on code generated by an AI or LLM tag: serverless Serverless support type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants