Skip to content

test(profiling): check eager task samples carry the task's own span - #21743

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
taegyunkim/profiling-eager-task-span-test
Nov 16, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
taegyunkim/profiling-eager-task-span-test

Conversation

@taegyunkim

@taegyunkim taegyunkim commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

JIRA: PROF-16348

Adds a test for an eager task (Python 3.12+) that starts its own trace while its creator's span is still open. Every sample of the child's work must carry the child's span id, local root span id and endpoint, and none may carry the parent's. The test first checks that the child really starts its own trace, so a change in span parenting fails at that check instead of looking like a profiler bug.

This passes on main, where task samples get the thread's latest span. It guards #21653. During an eager step, the sampler also emits the parent task, with the child's frames on top. Once task samples use their own task's span, that copy gets the parent's span.

Testing

The new test passes on main on Python 3.12, 3.13 and 3.14 (Linux aarch64, scripts/run-tests). With #21653 applied, it fails on 3.12.

Risks

None. Test only.

Additional Notes

None.

@taegyunkim taegyunkim added the changelog/no-changelog A changelog entry is not required for this PR. label Nov 12, 2026
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

tests/profiling/collector/test_stack_asyncio_endpoint_labels.py         @DataDog/profiling-python

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 73 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 73 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=120)
ddtrace.llmobs._integrations.bedrock -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.bedrock_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.typesafe -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.openai_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@taegyunkim
taegyunkim marked this pull request as ready for review November 16, 2026 15:13
@taegyunkim
taegyunkim requested a review from a team as a code owner November 16, 2026 15:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 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-11-16T15:14:23.368782Z 465a4c7 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-16T15:15:34.325443Z 465a4c7 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.

@KowalskiThomas KowalskiThomas added Profiling Continous Profling testing labels Nov 16, 2026
@taegyunkim

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-16 15:21:42 UTC ℹ️ Start processing command /merge


2026-11-16 15:22:08 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-11-16 15:24:17 UTC ℹ️ MergeQueue: merge request added to the queue

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


2026-11-16 16:06:26 UTC ℹ️ MergeQueue: This merge request was merged

@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 assertions cover incorrect parent attribution during the eager child’s first step and verify that the child starts an independent trace, distinguishing span-parenting changes from profiler attribution failures.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 465a4c7

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 33d2b57 into main Nov 16, 2026
489 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the taegyunkim/profiling-eager-task-span-test branch November 16, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR. Profiling Continous Profling testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants