pytest-opentelemetry
A pytest plugin for instrumenting test runs via OpenTelemetry
Decision gist · record as of 2026-08-14
Yes, if you already use or plan to adopt OpenTelemetry for observability and want detailed visibility into test performance. The plugin is actively maintained, has no known vulnerabilities, and integrates cleanly with pytest. Install it if you need to profile test bottlenecks or correlate test execution with application traces; skip it if you have no observability infrastructure or don't need test-level tracing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires an OpenTelemetry Collector or compatible OTLP gRPC endpoint running (default http://localhost:4317); only OTLP over gRPC exporter is currently supported.
- Low friction installation as a pure Python wheel.
- Actively maintained with a recent release (2025-04-25) and ongoing commits; last commit 2026-07-26.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute this plugin freely in commercial and private projects with minimal restrictions.
last release 2025-04-25 (476 days) · last repo commit 2026-07-26 · 40 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,205,304 downloads/mo, #4,225 on PyPI
Alternatives
Verify before relying
pip install pytest-opentelemetry
pytest --export-traces
# With custom collector endpoint:
export OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
pytest --export-traces- Whether pytest-xdist integration works with all versions of pytest-xdist or has known incompatibilities.
- Performance overhead of instrumentation on test suite runtime when traces are exported.
- Support for other OpenTelemetry exporters beyond OTLP gRPC in future versions.
What it is and what it does
pytest-opentelemetry is a pytest plugin that automatically captures detailed timing and execution data from your test runs as OpenTelemetry spans, then exports them to a tracing backend. It integrates seamlessly with pytest as a plugin—just install it and use the --export-traces flag to start collecting traces. By default it sends data to http://localhost:4317 (an OpenTelemetry Collector), which you can redirect to visualization tools like Jaeger.
The plugin helps identify test bottlenecks and performance regressions by giving you a detailed timeline of what your tests are doing. It works especially well with applications already instrumented with OpenTelemetry, letting you see the full stack from test code through database queries and network calls. It also supports pytest-xdist for distributed test runs, automatically unifying traces across multiple processes or hosts, and can nest test runs under a parent trace via the --trace-parent argument.
Use it for
- Identify which tests or fixtures are slowest in a large test suite to prioritize optimization efforts.
- Visualize integration test execution against a staging environment using Jaeger to debug failures faster.
- Connect test traces to application traces when testing OpenTelemetry-instrumented services to see end-to-end behavior.
- Debug local test performance issues by running pytest-opentelemetry locally and inspecting traces in Jaeger.
- Track test suite runtime trends over time by exporting traces to a persistent backend for historical analysis.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you already use or plan to adopt OpenTelemetry for observability and want detailed visibility into test performance.
The plugin is actively maintained, has no known vulnerabilities, and integrates cleanly with pytest. Install it if you need to profile test bottlenecks or correlate test execution with application traces; skip it if you have no observability infrastructure or don't need test-level tracing.
Install
pytest-opentelemetry on PyPI
Before you install
Low friction installation as a pure Python wheel. Actively maintained with a recent release (2025-04-25) and ongoing commits; last commit 2026-07-26. Depends on five runtime packages including opentelemetry-sdk and pytest itself, all standard in the ecosystem.
Requires an OpenTelemetry Collector or compatible OTLP gRPC endpoint running (default http://localhost:4317); only OTLP over gRPC exporter is currently supported.
License in practice
MIT license (permissive) means you can use, modify, and distribute this plugin freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pytest-opentelemetry
pytest --export-traces
# With custom collector endpoint:
export OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
pytest --export-traces
Verify before relying
- Whether pytest-xdist integration works with all versions of pytest-xdist or has known incompatibilities.
- Performance overhead of instrumentation on test suite runtime when traces are exported.
- Support for other OpenTelemetry exporters beyond OTLP gRPC in future versions.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesopentelemetry-apiopentelemetry-container-distroopentelemetry-sdkopentelemetry-semantic-conventionspytest |
| Maintenance | Actively maintained 476 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,205,304 / month, #4,225 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: PytestLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: pytest_opentelemetry-1.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest opentelemetry instrumentation”
- pytest-opentelemetryA pytest plugin that instruments test runs with OpenTelemetry,…
- opentelemetry-test-utilsProvides test utilities and helpers for writing unit tests for…
- opentelemetry-instrumentation-pymemcacheAdds OpenTelemetry tracing instrumentation to pymemcache client…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also buildkite-test-collector · pytest-otel · opentelemetry-exporter-jaeger · opentelemetry-exporter-jaeger-proto-grpc · azure-monitor-opentelemetry-exporter · opentelemetry-instrumentation · opentelemetry-exporter-jaeger-thrift · opentelemetry-test-utils · opentelemetry-instrumentation-jinja2 · opentelemetry-instrumentation-wsgi