Skip to content

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

Merged
mabdinur merged 11 commits intomasterfrom
munir/track-proccess-creation-telemetry
Mar 26, 2026
Merged

chore(telemetry): track process creation via it headers#5464
mabdinur merged 11 commits intomasterfrom
munir/track-proccess-creation-telemetry

Conversation

@mabdinur
Copy link
Copy Markdown
Contributor

@mabdinur mabdinur commented Mar 16, 2026

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 process lineage across forks and Process.spawn.

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:

n/a (this is an internal change that only impacts instrumentation telemetry collection)

How to test the change?

System tests:

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

github-actions bot commented Mar 16, 2026

👋 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-23 21:04:22 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
Copy Markdown

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: 75.89%
Overall Coverage: 95.13% (-0.00%)

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

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 16, 2026

Benchmarks

Benchmark execution time: 2026-03-24 18:03:47

Comparing candidate commit 2751beb 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 ----------------------------------'

@mabdinur mabdinur changed the title [WIP] chore(telemetry): track process creation via it headers chore(telemetry): track process creation via it headers Mar 23, 2026
@mabdinur mabdinur force-pushed the munir/track-proccess-creation-telemetry branch 2 times, most recently from 51ecc95 to fd64edc Compare March 23, 2026 20:34
@mabdinur mabdinur force-pushed the munir/track-proccess-creation-telemetry branch from fd64edc to 4fbe9f8 Compare March 23, 2026 20:35
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 1 untyped method and 1 partially typed method. It decreases the percentage of typed methods from 61.64% to 61.62% (-0.02%).

Untyped methods (+1-0)Introduced:
sig/datadog/core/utils/spawn_monkey_patch.rbs:11
└── def spawn: (*untyped args, **untyped opts) -> untyped
Partially typed methods (+1-0)Introduced:
sig/datadog/core/utils/spawn_monkey_patch.rbs:14
└── def self.inject_lineage_envs: (untyped args) -> ::Array[untyped]

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

@mabdinur mabdinur marked this pull request as ready for review March 23, 2026 21:05
@mabdinur mabdinur requested a review from a team as a code owner March 23, 2026 21:05
@mabdinur mabdinur requested a review from ivoanjo March 23, 2026 22:05
Copy link
Copy Markdown
Member

@Strech Strech left a comment

Choose a reason for hiding this comment

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

I think it looks good in general. But I think we can do a bit better by:

  1. Using AI (claude?) to write more detailed and standardized RBS files
  2. Following testing style from the existing specs
  3. Improving the caller-callee dependency from child-parent to parent-child

@mabdinur mabdinur requested a review from Strech March 24, 2026 18:34
Copy link
Copy Markdown
Member

@Strech Strech left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@mabdinur mabdinur merged commit aef62f2 into master Mar 26, 2026
912 of 914 checks passed
@mabdinur mabdinur deleted the munir/track-proccess-creation-telemetry branch March 26, 2026 17:44
@github-actions github-actions bot added this to the 2.31.0 milestone Mar 26, 2026
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 tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants