otel-extensions
Python extensions for OpenTelemetry
What it is and what it does
otel-extensions is a thin wrapper around the OpenTelemetry Python SDK that reduces boilerplate for common tracing tasks. It provides a decorator-based API to wrap functions and async functions with automatic span creation, a helper class to initialize the global tracer provider from environment variables or explicit options, and utilities for propagating trace context across process and thread boundaries.
The package is most useful when you want to instrument a Python application with distributed tracing but find the raw OpenTelemetry SDK verbose or repetitive. It handles OTLP endpoint configuration, span processor selection, and context attachment in a few lines of code, and its @instrumented decorator eliminates the need to manually call tracer.start_as_current_span() around every function you want to trace.
Use it for:
- Quickly add distributed tracing to a Python service by decorating functions with @instrumented and calling init_telemetry_provider() once at startup.
- Propagate trace context across worker threads or subprocess calls using TraceContextCarrier without manually managing context variables.
- Convert Python logging output into OpenTelemetry span events by attaching TraceEventLogHandler to your logger.
- Configure OTLP exporter endpoint, protocol, and TLS certificate entirely through environment variables without code changes.
- Instrument async functions and coroutines with automatic span wrapping using the same @instrumented decorator.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides helper classes, decorators, and functions to simplify setup and instrumentation of OpenTelemetry tracing in Python applications.
Yes, if you are already using OpenTelemetry and want to reduce instrumentation boilerplate. The low install friction and permissive license make it a safe addition. However, note that maintenance is dormant (last release 662 days ago); if you need active support or compatibility with very recent OpenTelemetry SDK versions, verify compatibility first or consider maintaining a fork.
Install
otel-extensions on PyPI
pip
pip install otel-extensionsuv
uv add otel-extensionspoetry
poetry add otel-extensionsInstalling otel-extensions
Before you install
Low install friction; pure Python wheel with only two runtime dependencies (opentelemetry-api and opentelemetry-sdk). Maintenance is dormant—last release was 662 days ago, though the repository remains active with a recent commit on 2024-10-21.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install otel-extensions
from otel_extensions import init_telemetry_provider, instrumented
init_telemetry_provider()
@instrumented
def my_function():
print("Hello World")
Requires Python >= 3.8; opentelemetry-api and opentelemetry-sdk must be installed and configured with an OTLP endpoint or environment variables.
Verify before relying
- Whether the package works with the latest opentelemetry-api and opentelemetry-sdk versions.
- Performance characteristics when using batch vs. simple span processors at scale.
- Support for async context propagation across thread boundaries beyond the documented examples.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — opentelemetry-api, opentelemetry-sdk |
| Maintenance | dormant — 662 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 238,046/month — #8,948 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: otel_extensions-1.1.0-py2.py3-none-any.whl
Keywords: otel, opentelemetry, debug
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
opentelemetry-instrumentation-threadingEnsures OpenTelemetry context is propagated…
permissive · top 1,000 on PyPI
pyroscope-otelConnects OpenTelemetry tracing with Pyroscope…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-djangoAdds distributed tracing to Django applications…
permissive · top 1,000 on PyPI
vercel-internal-telemetryProvides shared telemetry helpers for internal…
permissive · top 5,000 on PyPI
pytest-otelA pytest plugin that captures and exports…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-sklearnAdds distributed tracing instrumentation to…
permissive · top 15,000 on PyPI
otel-ciRecords and exports OpenTelemetry spans from…
unclear · top 15,000 on PyPI
opentelemetry-instrumentation-flaskAdds distributed tracing to Flask web…
permissive · top 1,000 on PyPI
azure-core-tracing-opentelemetryIntegrates Azure SDK clients with OpenTelemetry…
unclear · top 5,000 on PyPI
opentelemetry-instrumentation-redisAdds distributed tracing to Redis client calls…
permissive · top 1,000 on PyPI