SDK Benchmark Tests workflow (open-telemetry/opentelemetry-python)
The SDK Benchmark Tests workflow from open-telemetry/opentelemetry-python, explained and optimized by Latchkey.
CI health: C - fair
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the SDK Benchmark Tests workflow from the open-telemetry/opentelemetry-python repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: SDK Benchmark Tests
on:
push:
branches: [ main ]
permissions:
contents: read
jobs:
sdk-benchmarks:
permissions:
contents: write # required for pushing to gh-pages
runs-on: oracle-bare-metal-64cpu-1024gb-x86-64-ubuntu-24
container:
image: python:3.13-slim
steps:
- name: Install Git # since Git isn't available in the container image used above
run: |
apt-get update
apt-get install -y git
- name: Make repo safe for Git inside container
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
- name: Install tox
run: pip install tox-uv
- name: Run tox
run: tox -e benchmark-opentelemetry-sdk -- -k opentelemetry-sdk/benchmarks --benchmark-json=opentelemetry-sdk/output.json
- name: Report on SDK benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: OpenTelemetry Python SDK Benchmarks
tool: pytest
output-file-path: opentelemetry-sdk/output.json
gh-pages-branch: gh-pages
github-token: ${{ secrets.GITHUB_TOKEN }}
# Make a commit on `gh-pages` with benchmarks from previous step
benchmark-data-dir-path: "benchmarks"
auto-push: true
max-items-in-chart: 100
# Alert with a commit comment on possible performance regression
alert-threshold: '200%'
comment-on-alert: true
alert-comment-cc-users: "@open-telemetry/python-approvers,@open-telemetry/python-maintainers"
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: SDK Benchmark Tests on: push: branches: [ main ] permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: sdk-benchmarks: timeout-minutes: 30 permissions: contents: write # required for pushing to gh-pages runs-on: oracle-bare-metal-64cpu-1024gb-x86-64-ubuntu-24 container: image: python:3.13-slim steps: - name: Install Git # since Git isn't available in the container image used above run: | apt-get update apt-get install -y git - name: Make repo safe for Git inside container run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Checkout Core Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v4 - name: Install tox run: pip install tox-uv - name: Run tox run: tox -e benchmark-opentelemetry-sdk -- -k opentelemetry-sdk/benchmarks --benchmark-json=opentelemetry-sdk/output.json - name: Report on SDK benchmark results uses: benchmark-action/github-action-benchmark@v1 with: name: OpenTelemetry Python SDK Benchmarks tool: pytest output-file-path: opentelemetry-sdk/output.json gh-pages-branch: gh-pages github-token: ${{ secrets.GITHUB_TOKEN }} # Make a commit on `gh-pages` with benchmarks from previous step benchmark-data-dir-path: "benchmarks" auto-push: true max-items-in-chart: 100 # Alert with a commit comment on possible performance regression alert-threshold: '200%' comment-on-alert: true alert-comment-cc-users: "@open-telemetry/python-approvers,@open-telemetry/python-maintainers"
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.