Skip to content

test(debugger): accept flat dotted dd.trace_id in correlation gate - #7572

Open
p-datadog wants to merge 1 commit into
DataDog:grantseltzer/correlation-tests-gofrom
p-datadog:pi/accept-dotted-trace-id
Open

test(debugger): accept flat dotted dd.trace_id in correlation gate#7572
p-datadog wants to merge 1 commit into
DataDog:grantseltzer/correlation-tests-gofrom
p-datadog:pi/accept-dotted-trace-id

Conversation

@p-datadog

@p-datadog p-datadog commented Aug 24, 2026

Copy link
Copy Markdown
Member

Motivation

Stacked on #7425, which introduces the feature-564 test Test_Debugger_Coordinated_Sampling. The test groups snapshots by trace using dd.trace_id and read only the nested form under the dd object. The Ruby tracer (DataDog/dd-trace-rb#6118) emits dd.trace_id as a flat dotted key at the envelope root, matching the Java/.NET/Go convention, so dotted-key snapshots resolved to None and failed the presence assertion before any sampling logic ran.

Changes

Read dd.trace_id from both the nested dd object and the flat dotted key:

trace_id = snapshot.get("dd", {}).get("trace_id") or snapshot.get("dd.trace_id")

The coordinated-sampling gate reads dd.trace_id to group snapshots by
trace. The Ruby tracer emits it as a flat dotted key at the envelope
root ("dd.trace_id"), matching the Java/.NET/Go dotted-key convention,
while Python/Node/Ruby nest it under a dd object. The test read the
nested form only, so dotted-key snapshots resolved to None and failed
the presence assertion before any sampling logic ran.

Read both shapes, mirroring the dual-shape lookup already used for
dd.span_id in test_debugger_exception_replay.py.

Scope: the reported feature-564 test only. runtime_id (camelCase) and
the generation token remain nested/absent and stay out of scope.
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 24, 2026

Copy link
Copy Markdown

Tests

🔄 Datadog auto-retried 4 jobs - 1 passed on retry View in Datadog

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

@p-datadog
p-datadog marked this pull request as ready for review September 4, 2026 22:30
@p-datadog
p-datadog requested review from a team as code owners September 4, 2026 22:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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-09-04T22:32:14.251252Z e3da2e0 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants