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

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

Source: https://latchkey.dev/workflows/open-telemetry-opentelemetry-python-benchmarks  
Upstream: [open-telemetry/opentelemetry-python](https://github.com/open-telemetry/opentelemetry-python/blob/main/.github/workflows/benchmarks.yml) (.github/workflows/benchmarks.yml), licence Apache-2.0

## 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

```yaml
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"
```

## FAQ

### 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?

Add run de-duplication and job timeouts. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
