Skip to content

ci: add pre-release performance quality gates prototype #13506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

igoragoli
Copy link
Contributor

@igoragoli igoragoli commented May 26, 2025

https://datadoghq.atlassian.net/browse/APMSP-2000

Overview

Add a prototype for pre-release performance quality gates. This prototype doesn't actually gate anything.

Motivation

Necessary to validate the approach proposed in the pre-release performance quality gates RFC.

Testing

Testing pipelines:

Threshold configuration files added in: https://github.com/DataDog/benchmarking-platform/pull/157

Notifications are correctly being sent to #pre-release-gates-prototype.

Checklist

  • 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

  • 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

@igoragoli igoragoli requested review from a team as code owners May 26, 2025 13:29
Copy link
Contributor

CODEOWNERS have been resolved as:

.gitlab/benchmarks/macrobenchmarks.yml                                  @DataDog/python-guild @DataDog/apm-core-python

Copy link
Contributor

github-actions bot commented May 26, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 270 ± 10 ms.

The average import time from base is: 270 ± 10 ms.

The import time difference between this PR and base is: -6.1 ± 0.5 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.549 ms (0.58%)
ddtrace.bootstrap.sitecustomize 0.855 ms (0.32%)
ddtrace.bootstrap.preload 0.855 ms (0.32%)
ddtrace.internal.remoteconfig.client 0.855 ms (0.32%)
ddtrace 0.694 ms (0.26%)

@pr-commenter
Copy link

pr-commenter bot commented May 26, 2025

Benchmarks

Benchmark execution time: 2025-05-29 19:10:39

Comparing candidate commit 02f0eaa in PR branch igoragoli/add-pre-release-gates with baseline commit 520cbf5 in branch main.

Found 1 performance improvements and 1 performance regressions! Performance is the same for 506 metrics, 8 unstable metrics.

scenario:iastdjangostartup-iast

  • 🟩 execution_time [-438.653ms; -215.568ms] or [-18.403%; -9.044%]

scenario:telemetryaddmetric-1-gauge-metric-1-times

  • 🟥 execution_time [+157.983ns; +236.050ns] or [+7.364%; +11.002%]

@erikayasuda erikayasuda added the changelog/no-changelog A changelog entry is not required for this PR. label May 29, 2025
Copy link
Contributor

@erikayasuda erikayasuda left a comment

Choose a reason for hiding this comment

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

LGTM, just one NB question 👍

Comment on lines +380 to +384
check-warning-breaches:
extends: .check-threshold-breaches
script:
- cd platform && (git init && git remote add origin https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform && git pull origin python/macrobenchmarks)
- bp-runner bp-runner.fail-on-breach.warning.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

NB: I saw in the last pipeline that the macrobenchmarks pipeline was triggered and the SLO warning job failed. Initially I thought that we should be setting this as allow_fail: true so that a warning doesn't become a blocker for PRs... but then I realized that would make it silent on the main branch, which is what we're trying to alleviate 😅 If the intention of these checks is only for pre-release gating, maybe we can make this only trigger on main and release branches?

What are your thoughts? 🤔

Suggested change
check-warning-breaches:
extends: .check-threshold-breaches
script:
- cd platform && (git init && git remote add origin https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform && git pull origin python/macrobenchmarks)
- bp-runner bp-runner.fail-on-breach.warning.yml
check-warning-breaches:
extends: .check-threshold-breaches
only:
- main
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
script:
- cd platform && (git init && git remote add origin https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform && git pull origin python/macrobenchmarks)
- bp-runner bp-runner.fail-on-breach.warning.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi!

so that a warning doesn't become a blocker for PRs

I've made some updates. In summary, only one check-slo-breaches job is necessary, and it'll check for warnings with a range defined on the thresholds file (bp-runner.fail-on-breach.yml). Warnings won't fail the job 👍

we can make this only trigger on main and release branches?

Exactly, benchmarks considered for gating releases should be run on main and release branches.

This is not the case for Python macrobenchmarks, which only run on schedule: https://github.com/DataDog/dd-trace-py/blob/main/.gitlab-ci.yml#L91-L94

Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

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

something we found, the main trigger job needs to be strategy: depend for the trigger

Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

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

we might want to try and do similar as the microbenchmarks which will use the artifacts from the download_ddtrace_artifacts and use the pre-built wheels instead of installing from source which takes a few minutes.

@igoragoli
Copy link
Contributor Author

Closing this due to updates on how breaches are checked, and due to the example PR I've added: #13584

@erikayasuda, this example PR can be a basis for the PR you need to add for https://datadoghq.atlassian.net/browse/APMSP-2051.

@igoragoli igoragoli closed this Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.21 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.

4 participants