Skip to content

[WIP] chore(telemetry): track process creation via it headers#5464

Draft
mabdinur wants to merge 3 commits intomasterfrom
munir/track-proccess-creation-telemetry
Draft

[WIP] chore(telemetry): track process creation via it headers#5464
mabdinur wants to merge 3 commits intomasterfrom
munir/track-proccess-creation-telemetry

Conversation

@mabdinur
Copy link
Contributor

What does this PR do?

Adds telemetry session ID headers (DD-Session-ID, DD-Root-Session-ID, DD-Parent-Session-ID) for the Stable Service Instance Identifier RFC. Tracks session lineage across forks and Process.spawn via Identity and a spawn monkey patch.

Motivation:

Support Stable Service Instance Identifier RFC and pass system-tests test_session_id_headers_across_forks and test_session_id_headers_across_spawned.

Change log entry

  • Add telemetry session ID headers (DD-Session-ID, DD-Root-Session-ID, DD-Parent-Session-ID) for process lineage tracking across forks and spawned processes.

Additional Notes:
N/A

How to test the change?

TEST_LIBRARY=ruby ./run.sh DEFAULT -k "test_session_id_headers_across_forks or test_session_id_headers_across_spawned" in system-tests with dd-trace-rb in binaries/dd-trace-rb.

PR: DataDog/system-tests#6510

@github-actions github-actions bot added the core Involves Datadog core libraries label Mar 16, 2026
@github-actions
Copy link

👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-03-16 21:11:29 UTC

@mabdinur mabdinur added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Mar 16, 2026
@datadog-datadog-prod-us1-2
Copy link

datadog-datadog-prod-us1-2 bot commented Mar 16, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 68.18%
Overall Coverage: 95.14% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1ac18f3 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Mar 16, 2026

Benchmarks

Benchmark execution time: 2026-03-16 21:54:31

Comparing candidate commit 1ac18f3 in PR branch munir/track-proccess-creation-telemetry with baseline commit 6f300a1 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Comment on lines +40 to +43
# Root of the fork tree (Stable Service Instance Identifier). Nil in root process.
def ancestor_runtime_id
@ancestor_runtime_id
end
Copy link
Member

Choose a reason for hiding this comment

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

Minor: It's kinda weird that the same concept is getting two names in this PR -- "ancestor" and "root". Maybe worth picking one name and using it throughout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup this is a carryover from my python implementation. I'll clean it up 😄

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

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos core Involves Datadog core libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants