chore(release): add pre-release performance regression gating
Adding pre-release performance regression gating. This sets SLO thresholds for some key macrobenchmarks, and now runs macrobenchmarks on any release tags that are created. If any SLOs are breached, it will block the release.
This should not cause surprise breaches, since the macrobenchmarks run nightly. When we get close to hitting the SLO threshold, there will be a warning Slack alert in the #apm-python-release channel to preemptively give us a heads up that an SLO will be breached soon. When there is a breach, there will also be a Slack alert in the same channel.
Thresholds were determined by generally following the guidelines outlined here. The TL;DR is outlined below: From the more recent macrobenchmark runs, I generally calculated:
threshold = mean ± (2 × standard deviation)
The + or - was determined by the type of benchmark.
For throughput, we desire higher values, so we use - to add slack. For execution_time, we desire lower values, so we use + to add slack.
Depending on the benchmark, variance across pipelines was pretty wide, so the buffer had to be adjusted from the default of 2 × standard deviation in order to make sure the warning alert wasn't too noisy.
See APMSP-2051
Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the library release note guidelines
- The change includes or references documentation updates if necessary
- Backport labels are set (if applicable)
Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking API changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the release branch maintenance policy
CODEOWNERS have been resolved as:
.gitlab/benchmarks/bp-runner.fail-on-breach.yml @DataDog/python-guild @DataDog/apm-core-python
.gitlab-ci.yml @DataDog/apm-core-python
.gitlab/benchmarks/macrobenchmarks.yml @DataDog/python-guild @DataDog/apm-core-python
Bootstrap import analysis
Comparison of import times between this PR and base.
Summary
The average import time from this PR is: 273 ± 2 ms.
The average import time from base is: 274 ± 2 ms.
The import time difference between this PR and base is: -1.63 ± 0.1 ms.
Import time breakdown
The following import paths have shrunk:
ddtrace.auto
1.910 ms
(0.70%)
ddtrace.bootstrap.sitecustomize
1.241 ms
(0.45%)
ddtrace.bootstrap.preload
1.241 ms
(0.45%)
ddtrace.internal.remoteconfig.client
0.634 ms
(0.23%)
ddtrace
0.669 ms
(0.25%)
ddtrace.internal._unpatched
0.030 ms
(0.01%)
json
0.030 ms
(0.01%)
json.decoder
0.030 ms
(0.01%)
re
0.030 ms
(0.01%)
enum
0.030 ms
(0.01%)
types
0.030 ms
(0.01%)
Benchmarks
Benchmark execution time: 2025-06-27 13:59:56
Comparing candidate commit 7404bb9130ac1309ba77a24535be831062f2a418 in PR branch erikayasuda/prereleasegates with baseline commit 5fdd9c23c8f9886d201335b8b2ac141fc95bc517 in branch main.
Found 0 performance improvements and 3 performance regressions! Performance is the same for 346 metrics, 3 unstable metrics.
scenario:iastaspectsospath-ospathbasename_aspect
- 🟥
execution_time[+523.683ns; +721.836ns] or [+12.230%; +16.857%]
scenario:iastaspectsospath-ospathsplit_aspect
- 🟥
execution_time[+808.594ns; +1002.938ns] or [+16.610%; +20.602%]
scenario:iastaspectsospath-ospathsplitext_aspect
- 🟥
execution_time[+642.305ns; +798.922ns] or [+14.156%; +17.608%]