Skip to content

[PROF-15045] Profling: Omit local root span id in reported profiles - #6120

Draft
ivoanjo wants to merge 1 commit into
masterfrom
ivoanjo/prof-15045-omit-local-root-span-id
Draft

[PROF-15045] Profling: Omit local root span id in reported profiles#6120
ivoanjo wants to merge 1 commit into
masterfrom
ivoanjo/prof-15045-omit-local-root-span-id

Conversation

@ivoanjo

@ivoanjo ivoanjo commented Jul 29, 2026

Copy link
Copy Markdown
Member

What does this PR do?

This PR uses the new libdatadog setting
ddog_prof_Profile_set_omit_local_root_span_id_when_serializing to omit the "local root span id" label in profiles.

Motivation:

The backend no longer uses this label, so we're experimenting with phasing it out.

Change log entry

None. (This is not a user-visible change)

Additional Notes:

I'm opening this as a draft until we make a decision if we want to ship it or not; the change is otherwise ready and working.

How to test the change?

I've updated the tests to match this new world. I've also manually reported profiles to staging and could spot no issues in the trace-to-profile integration (which is the feature that in the past required this information to work).

Here's my tiny test app:

require "datadog"

def burn_cpu_for_n_millis(n)
  limit = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) + n * 1_000_000
  while Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) < limit
    # Do nothing
  end
end

Datadog::Tracing.trace("GET /foo", type: "web") do
  burn_cpu_for_n_millis(50)

  Datadog::Tracing.trace("child") do
    burn_cpu_for_n_millis(50)
  end
end

sleep 1

**What does this PR do?**

This PR uses the new libdatadog setting
`ddog_prof_Profile_set_omit_local_root_span_id_when_serializing` to
omit the "local root span id" label in profiles.

**Motivation:**

The backend no longer uses this label, so we're experimenting
with phasing it out.

**Additional Notes:**

I'm opening this as a draft until we make a decision if we want
to ship it or not; the change is otherwise ready and working.

**How to test the change?**

I've updated the tests to match this new world. I've also manually
reported profiles to staging and could spot no issues in the
trace-to-profile integration (which is the feature that in the
past required this information to work).

Here's my tiny test app:

```ruby
require "datadog"

def burn_cpu_for_n_millis(n)
  limit = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) + n * 1_000_000
  while Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) < limit
    # Do nothing
  end
end

Datadog::Tracing.trace("GET /foo", type: "web") do
  burn_cpu_for_n_millis(50)

  Datadog::Tracing.trace("child") do
    burn_cpu_for_n_millis(50)
  end
end

sleep 1
```
@dd-octo-sts dd-octo-sts Bot added the profiling Involves Datadog profiling label Jul 29, 2026
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jul 29, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 9 Pipeline jobs failed

Unit Tests | Ruby 2.6 / build &amp; test (standard) [0]   View in Datadog   GitHub Actions

Unit Tests | Ruby 2.7 / build &amp; test (standard) [0]   View in Datadog   GitHub Actions

Unit Tests | Ruby 3.0 / build &amp; test (standard) [0]   View in Datadog   GitHub Actions

View all 9 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: aabe512 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 29, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-29 07:30:26

Comparing candidate commit aabe512 in PR branch ivoanjo/prof-15045-omit-local-root-span-id with baseline commit 5af1f3e in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 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 ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:tracing - trace.to_digest - Continue

  • unstable throughput [-1249.828op/s; +1744.902op/s] or [-4.270%; +5.961%]

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

Labels

profiling Involves Datadog profiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant