--- id: pytest-opentelemetry version: "1.1.0" license: unclear license_treatment: permissive maintenance: active --- # pytest-opentelemetry — A pytest plugin for instrumenting test runs via OpenTelemetry License: permissive · Maintenance: active · Downloads: 1.2M/mo ## 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 above — verify before relying. A pytest plugin that instruments test runs with OpenTelemetry, exporting span and timing data to trace backends like Jaeger for performance analysis and debugging. 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 pip install pytest-opentelemetry uv add pytest-opentelemetry poetry add pytest-opentelemetry ## Installing pytest-opentelemetry 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. 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 Requires an OpenTelemetry Collector or compatible OTLP gRPC endpoint running (default http://localhost:4317); only OTLP over gRPC exporter is currently supported. 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest opentelemetry instrumentation, test suite tracing and monitoring, pytest performance profiling, opentelemetry pytest plugin, test execution span export, pytest jaeger integration, distributed test tracing, observability, performance-profiling, distributed-tracing [View on SkillFed](https://skillfed.io/packages/pytest-opentelemetry) · [View on PyPI](https://pypi.org/project/pytest-opentelemetry/)