pytest-otel
OpenTelemetry plugin for Pytest
Decision gist · record as of 2026-08-14
Yes, if you already run an OpenTelemetry collector and want to observe test execution within your observability stack. The plugin is actively maintained, has low install friction, and is permissively licensed. Install only if you have an OTLP endpoint available and a clear use case for tracing test runs; it adds a runtime dependency on three OpenTelemetry packages and requires Python 3.10+.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires an OpenTelemetry collector or backend endpoint (--otel-endpoint is mandatory); Python 3.10 or later.
- Low friction install with a pure-Python wheel.
- Actively maintained as of 46 days ago.
License · maintenance · safety
permissive license (permissive) — Apache License 2.0 (permissive) allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-06-29 (46 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 89,003 downloads/mo, #13,685 on PyPI
Alternatives
Verify before relying
pip install pytest-otel
pytest --otel-endpoint https://otelcollector.example.com:4317 \
--otel-service-name my_service \
--otel-session-name='My_Test_cases'- Whether the plugin automatically instruments all test functions or requires explicit decorator/fixture usage.
- Support for distributed tracing context propagation across test suites or CI/CD pipelines.
- Performance overhead of span export during test execution.
What it is and what it does
pytest-otel is a pytest plugin that integrates OpenTelemetry tracing into your test runs. It wraps test execution in spans and exports them to an OTLP-compatible backend (such as Jaeger or Elastic APM), allowing you to observe test performance and behavior through your observability stack. The plugin is configured via command-line flags or environment variables and supports both gRPC and HTTP/protobuf OTLP protocols.
You provide an OpenTelemetry endpoint URL, service name, and optional headers, then run pytest with the plugin enabled. Each test becomes a span in your trace backend, where you can inspect execution time, failures, and correlate test runs with other system traces. The plugin supports dotenv files for managing configuration and allows trace parent IDs to be passed in for linking to upstream traces.
Use it for
- Export test execution traces to Jaeger for visual debugging of slow or flaky tests.
- Correlate test failures with application traces in Elastic Stack or other APM tools.
- Monitor test suite performance over time by analyzing span data in your observability platform.
- Link test execution spans to distributed traces from CI/CD pipelines or deployment systems.
- Debug test interactions with external services by viewing spans alongside application instrumentation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you already run an OpenTelemetry collector and want to observe test execution within your observability stack.
The plugin is actively maintained, has low install friction, and is permissively licensed. Install only if you have an OTLP endpoint available and a clear use case for tracing test runs; it adds a runtime dependency on three OpenTelemetry packages and requires Python 3.10+.
Install
pytest-otel on PyPI
Before you install
Low friction install with a pure-Python wheel. Actively maintained as of 46 days ago. Requires pytest and three OpenTelemetry packages (api, sdk, exporter-otlp) as runtime dependencies.
Requires an OpenTelemetry collector or backend endpoint (--otel-endpoint is mandatory); Python 3.10 or later.
License in practice
Apache License 2.0 (permissive) allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install pytest-otel
pytest --otel-endpoint https://otelcollector.example.com:4317 \
--otel-service-name my_service \
--otel-session-name='My_Test_cases'
Verify before relying
- Whether the plugin automatically instruments all test functions or requires explicit decorator/fixture usage.
- Support for distributed tracing context propagation across test suites or CI/CD pipelines.
- Performance overhead of span export during test execution.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesopentelemetry-apiopentelemetry-exporter-otlpopentelemetry-sdkpytest |
| Maintenance | Actively maintained 46 days since the last release |
| First released | |
| Downloads | 89,003 / month, #13,685 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: PluginsFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities |
Evidence: pytest_otel-2.4.0-py2.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 tracing”
- pytest-otelA pytest plugin that captures and exports OpenTelemetry spans for…
- pytest-opentelemetryA pytest plugin that instruments test runs with OpenTelemetry,…
- pytest-mergifyA pytest plugin that integrates with Mergify to trace tests via…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
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.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
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.
See also otel-ci · pytest-opentelemetry · otel-extensions · opentelemetry-exporter-otlp-proto-grpc · opentelemetry-exporter-otlp · opentelemetry-exporter-otlp-proto-http · microsoft-opentelemetry · pyroscope-otel · opentelemetry-test-utils · opentelemetry-instrumentation