Skip to content
Latchkey

SDK Benchmark Tests workflow (open-telemetry/opentelemetry-python)

The SDK Benchmark Tests workflow from open-telemetry/opentelemetry-python, explained and optimized by Latchkey.

C

CI health: C - fair

The optimized version below adds run de-duplication, job timeouts, SHA-pinned actions.

Source: open-telemetry/opentelemetry-python.github/workflows/benchmarks.ymlLicense Apache-2.0View source

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

workflow (.yml)
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: latchkey-small    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

  • Run on Latchkey managed runners with one line (runs-on), which apply the fixes below automatically and self-heal transient failures. This example uses latchkey-small; pick the runner size that fits the job.
  • 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.

Actions used in this workflow

actions/checkout benchmark-action/github-action-benchmark

Frequently asked questions

What does the SDK Benchmark Tests workflow (open-telemetry/opentelemetry-python) workflow do?
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.
What CI health grade does this workflow get?
This Automation and other workflow grades C. Paste your own workflow into the Latchkey grader to see its grade and the exact fixes.
How can I improve this Automation and other workflow?
Apply run de-duplication, job timeouts, SHA-pinned actions. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

References