|
| 1 | +# Benchmarks |
| 2 | + |
| 3 | +This directory contains the configuration for the performance benchmarks that |
| 4 | +run on the [Datadog Benchmarking Platform](https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/2419261562/Benchmarking+Platform) |
| 5 | +via GitLab CI. Benchmarks are split into three complementary suites plus the |
| 6 | +shared performance-gate configuration. |
| 7 | + |
| 8 | +## Layout |
| 9 | + |
| 10 | +- **`micro/`** — Go microbenchmarks (`go test -bench`) executed on every PR. |
| 11 | + Each PR is compared against a baseline (`main`) and the pipeline fails on |
| 12 | + regressions above the configured thresholds. See `micro/README.md` for how |
| 13 | + to add, run, or mark benchmarks as flaky, and how to run the pipeline |
| 14 | + locally with `bp-runner`. |
| 15 | +- **`macro/`** — End-to-end macrobenchmarks that build the |
| 16 | + [`go-prof-app`](https://gitlab.ddbuild.io/DataDog/benchmarking-platform) |
| 17 | + SUT with the candidate `dd-trace-go` and exercise it under realistic load |
| 18 | + scenarios (`io-bound`, `cpu-bound`, `cgo-cpu-bound`, etc.). Runs |
| 19 | + automatically on `main` and release branches, and on-demand (manual) on |
| 20 | + feature branches. Used to detect regressions in tracer, profiler, AppSec, |
| 21 | + and service-extensions overhead. |
| 22 | +- **`test-apps/`** — Long-running test applications (e.g. `unit-of-work`) |
| 23 | + used to capture profiles and validate behavior over extended runs |
| 24 | + (~10+ minutes). Triggered manually; useful for investigating issues that |
| 25 | + short benchmarks cannot reproduce. |
| 26 | +- **`pr-gate.thresholds.yml`** — Regression thresholds enforced by the |
| 27 | + `pr-performance-gates` job for microbenchmark PR runs. |
| 28 | +- **`pre-release-gate.slos.yml`** — SLOs evaluated before releases to gate |
| 29 | + promotion based on macrobenchmark results. |
| 30 | + |
| 31 | +## External: `go-go-prof-app-parallel` |
| 32 | + |
| 33 | +In addition to the suites under this directory, the top-level |
| 34 | +`.gitlab-ci.yml` includes a shared pipeline definition from the |
| 35 | +[`DataDog/apm-reliability/apm-sdks-benchmarks`](https://gitlab.ddbuild.io/DataDog/apm-reliability/apm-sdks-benchmarks) |
| 36 | +project: |
| 37 | + |
| 38 | +```yaml |
| 39 | +- project: 'DataDog/apm-reliability/apm-sdks-benchmarks' |
| 40 | + file: '.gitlab/ci-go-go-prof-app-parallel.yml' |
| 41 | + ref: 'main' |
| 42 | +``` |
| 43 | +
|
| 44 | +This contributes the `go-go-prof-app-parallel` and |
| 45 | +`go-go-prof-app-parallel-slo` stages, which run a next-generation, |
| 46 | +parallelized variant of the `go-prof-app` macrobenchmarks. The job |
| 47 | +definitions, SUT image, and SLOs are maintained centrally in |
| 48 | +`apm-sdks-benchmarks` (shared across APM SDK repositories) rather than |
| 49 | +in this repository. These benchmarks are intended to replace the legacy |
| 50 | +`macro/` suite long term; until that migration completes, both suites |
| 51 | +run side by side. To change thresholds, scenarios, or runner |
| 52 | +configuration for this suite, open a PR against |
| 53 | +`apm-sdks-benchmarks`. |
| 54 | + |
| 55 | +## How it fits together |
| 56 | + |
| 57 | +1. On every PR, `micro/gitlab-ci.yml` runs the microbenchmarks suite and |
| 58 | + compares results against `main` using `pr-gate.thresholds.yml`. |
| 59 | +2. On `main` and release branches, `macro/gitlab-ci.yml` runs the |
| 60 | + macrobenchmarks suite; results are evaluated against |
| 61 | + `pre-release-gate.slos.yml` before a release is cut. |
| 62 | +3. `test-apps/test-apps.yml` provides manual jobs for deeper investigation |
| 63 | + when micro/macro signals are not sufficient. |
| 64 | +4. The `go-go-prof-app-parallel` and `go-go-prof-app-parallel-slo` stages run the next-generation parallel `go-prof-app` |
| 65 | + macrobenchmarks alongside the legacy `macro/` suite. |
| 66 | + |
| 67 | +Each suite pins its own CI image and runs on dedicated |
| 68 | +bare-metal GitLab runners to keep results stable: |
| 69 | + |
| 70 | +- **Microbenchmarks** use `MICROBENCHMARKS_CI_IMAGE` and **test-apps** use `TESTAPPS_BENCHMARKS_CI_IMAGE`: |
| 71 | + `registry.ddbuild.io/ci/benchmarking-platform:dd-trace-go-<job-id>`, |
| 72 | + built from `micro/container/` (a `golang` base plus `bp-runner` tooling |
| 73 | + installed via `bp-install`). |
| 74 | +- **Macrobenchmarks** use `MACROBENCHMARKS_CI_IMAGE`: |
| 75 | + `486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:go-go-prof-app-and-serviceextensions-and-haproxy-<rev>`, |
| 76 | + which bundles the `go-prof-app` SUT, the Envoy service-extensions and |
| 77 | + HAProxy SPOA harnesses. |
| 78 | + |
| 79 | +For details on running, extending, or debugging a specific suite, see the |
| 80 | +README inside each subdirectory. |
0 commit comments