Skip to content

ci(benchmarks): gate cpu and rss on all python-server-utilization scenarios - #21098

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
augusto/improve-benchmarking-coverage-dd-trace-py
Oct 21, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
augusto/improve-benchmarking-coverage-dd-trace-py

Conversation

@igoragoli

@igoragoli igoragoli commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Why

Benchmarking Platform Coverage defines the criteria for benchmarking coverage. The standard set of metrics that should be gated:

  • p50 and p95 request latency, for average-load scenarios (normal_operation).
  • Throughput, for stress scenarios (high_load).
  • CPU and RSS, for all scenarios.

dd-trace-py gates latency and throughput across its macrobenchmark configurations, but gates cpu_usage_percentage and rss on a single scenario (normal_operation/tracing-profiling-enabled/python-server-utilization). This PR extends CPU and RSS thresholds to every scenario that produces a utilization series.

APMSP-4112 Raise gates coverage on dd-trace-py

What

bp-analyzer generate slos offers two threshold strategies: tight (CI-based, T=5%) for low-variability series, and loose (mean+3σ) for high-variability series. The choice is per metric and scenario, made from the series of the last three main pipelines (145585442, 145520634, 145463714).

So we gate:

  • rss on every scenario with a utilization series (normal_operation, high_load): plateaus are stable across pipelines (coefficient of variation ≈ 2%).
  • cpu_usage_percentage on every normal_operation and high_load scenario: plateau means are stable across pipelines (coefficient of variation ≤ 5%), and the high_load ramp shape is consistent from run to run.
  • Nothing on the warmup stage: warmup measures warmup, not steady state, so we never gate it. The evidence is in the data: two of the 72 warmup-cpu runs show a start-of-stage transient (~400% vs a ~220% plateau in the first fifth of the stage).

Existing entries are untouched; only missing CPU/RSS thresholds are added (generated from the same three pipelines (145585442, 145520634, 145463714), max per metric, rss in MB, generated values rounded UP to whole numbers: plain rounding went the wrong direction on over half the entries, so we take the ceiling). Warmup stages are not gated, by convention.

Testing

  • bp-analyzer compare vsthresholds --fail_on_breach against each of the last three main pipelines' candidate artifacts passes: no breaches, no missing scenarios (all gated scenarios found in every pipeline).
  • Note: within single high_load runs the analyzer marks cpu_usage_percentage as unstable (the ramp inflates intra-run variance); it downgrades those checks to non-blocking, and the gates still enforce whenever the series is stable.

Notes

  • Release enforcement on GitHub: the repo's "Pre-release performance quality gates" ruleset (tag target) requires dd-gitlab/pre-release-gate-prototype and is in evaluate (non-blocking) mode; no active ruleset requires the GitLab check-slo-breaches context. The GitLab-side wiring is blocking (when: always, no allow_failure in the gate chain) — raising the GitHub ruleset to active would be a separate, admin-level change.

@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.

.gitlab/benchmarks/bp-runner.macrobenchmarks.fail-on-breach.yml         @DataDog/apm-ecosystems-performance @DataDog/apm-core-python

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

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

Show existing violations (showing 5 of 135 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=121)
ddtrace.llmobs._integrations.openai_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=119)
ddtrace.appsec._contrib.django -×-> ddtrace.trace  (product:aap -> product:tracing, score=119)
ddtrace.llmobs._utils -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=119)
ddtrace.internal.ci_visibility.filters -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=119)

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

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

Changelog | Validate changelog

View more details · View in GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🚧 1 test that failed was ignored due to quarantine View in Datadog

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-10-21 11:41:52

Comparing candidate commit 5b6e8d2 in PR branch augusto/improve-benchmarking-coverage-dd-trace-py with baseline commit df316cf in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 5 performance regressions! Performance is the same for 618 metrics, 10 unstable metrics, 6 known flaky benchmarks, 18 flaky benchmarks without significant changes.

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 ----------------------------------'

scenario:iastaspectsremodule-re_expand_aspect

  • 🟥 execution_time [+82.994µs; +92.760µs] or [+13.450%; +15.033%]

scenario:msgpackencoderscenario-simple_one_span

  • 🟥 execution_time [+444.743ns; +516.317ns] or [+11.110%; +12.898%]

scenario:openfeatureflagevaluation-hook-enqueue-typical

  • 🟥 execution_time [+1.795µs; +1.922µs] or [+8.249%; +8.833%]

scenario:otelspan-start

  • 🟥 execution_time [+2.371ms; +3.539ms] or [+9.121%; +13.616%]

scenario:recursivecomputation-shallow

  • 🟥 execution_time [+50.336µs; +54.511µs] or [+7.253%; +7.855%]

Unstable benchmarks

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

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-690.140ns; +766.492ns] or [-6.504%; +7.223%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-41.904ns; +36.036ns] or [-6.172%; +5.308%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1961.049ns; +1877.944ns] or [-9.808%; +9.392%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1000.343ns; +2658.666ns] or [-5.312%; +14.117%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-332.653ns; +424.961ns] or [-7.804%; +9.970%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-225.489ns; +233.880ns] or [-8.361%; +8.672%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-35.738ns; +152.495ns] or [-2.564%; +10.941%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-3984.272ns; +5682.736ns] or [-8.007%; +11.420%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-795.504ns; +1156.541ns] or [-7.577%; +11.017%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-57.641µs; +52.298µs] or [-10.007%; +9.080%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.082µs; +2.179µs] or [+15.034%; +15.729%]

scenario:iastaspects-translate_aspect

  • 🟥 execution_time [+97.573µs; +102.720µs] or [+14.505%; +15.270%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+145.044µs; +152.060µs] or [+38.138%; +39.983%]

scenario:span-start

  • 🟥 execution_time [+1.040ms; +1.329ms] or [+9.130%; +11.673%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+271.918ns; +317.827ns] or [+14.035%; +16.405%]

scenario:tracer-small

  • 🟥 execution_time [+41.551µs; +43.283µs] or [+18.042%; +18.794%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-casefold_noaspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-rstrip_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:iastaspectssplit-rsplit_aspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

@igoragoli igoragoli changed the title ci(benchmarks): gate cpu and rss on all macrobenchmark scenarios ci(benchmarks): gate cpu and rss on all python-server-utilization scenarios Oct 21, 2026
@igoragoli
igoragoli marked this pull request as ready for review October 21, 2026 11:08
@igoragoli
igoragoli requested review from a team as code owners October 21, 2026 11:08
@igoragoli
igoragoli requested review from brettlangdon and removed request for a team October 21, 2026 11:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-10-21T11:10:29.525777Z 82f01f5 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-21T11:11:17.462705Z 82f01f5 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.

@igoragoli igoragoli added the changelog/no-changelog A changelog entry is not required for this PR. label Oct 21, 2026

@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

CPU and RSS thresholds cover all configured steady-state utilization scenarios without duplicates, preserve existing thresholds, and exclude warmup. The completed static review found no actionable defects.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 82f01f5

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 20070ef into main Oct 21, 2026
709 of 710 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the augusto/improve-benchmarking-coverage-dd-trace-py branch October 21, 2026 12:35
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants