OpenTelemetry Python
CNCF standard SDK for distributed tracing, metrics, and logs in Python. OpenTelemetry provides vendor-neutral instrumentation that exports to any backend (Jaeger, Zipkin, Datadog, New Relic, Grafana Tempo). Auto-instrumentation patches popular libraries (requests, Flask, FastAPI, SQLAlchemy) with zero code changes. The industry standard replacing vendor-specific APM SDKs.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Spans may contain sensitive data (SQL queries, HTTP bodies) — configure attribute filtering before export. OTLP exporters should use TLS. API keys for backends must be kept in environment variables.
⚡ Reliability
Best When
You're building distributed Python services and want vendor-neutral observability with distributed tracing, metrics, and the ability to switch backends.
Avoid When
You need quick error tracking for a simple app — Sentry is much simpler to set up for basic error monitoring.
Use Cases
- • Add distributed tracing to Python microservices with auto-instrumentation for FastAPI, requests, SQLAlchemy, and Redis
- • Emit vendor-neutral spans and metrics that export to any OTEL-compatible backend without vendor lock-in
- • Trace LLM calls and token usage in AI agent pipelines for observability and debugging
- • Correlate traces, metrics, and logs with shared trace context propagated across service boundaries
- • Replace vendor-specific APM SDKs (Datadog, New Relic) with portable OTEL instrumentation
Not For
- • Simple logging — use Loguru or structlog for application-level logging without distributed tracing
- • Projects that need immediate visibility without configuration — Sentry is simpler for error tracking and basic APM
- • Very small single-service applications where APM overhead outweighs visibility benefits
Interface
Authentication
SDK itself has no auth — exporters to backends (OTLP endpoint) may require API keys or bearer tokens depending on the backend (Grafana Cloud, Honeycomb, etc.).
Pricing
OpenTelemetry SDK is Apache 2.0 licensed and free. Observability backend (Jaeger self-hosted, Grafana Cloud, Honeycomb, Datadog) is where costs occur.
Agent Metadata
Known Gotchas
- ⚠ Auto-instrumentation requires installing separate packages per library (opentelemetry-instrumentation-fastapi, opentelemetry-instrumentation-requests) — the base SDK doesn't auto-instrument anything
- ⚠ Tracer provider must be configured before any instrumented libraries are imported — late configuration misses spans from early imports
- ⚠ OTEL SDK fails silently when exporter is misconfigured — always add a console exporter during development to verify traces are being generated
- ⚠ Context propagation across HTTP requires both injecting and extracting W3C TraceContext headers — missing one side breaks distributed traces
- ⚠ The OTEL Python SDK has separate packages for tracing (opentelemetry-sdk), metrics (opentelemetry-sdk), and exporter per backend — assembling the right package set is non-trivial
- ⚠ Sampling configuration affects trace completeness — head-based sampling on the SDK side means some traces are never started; tail-based sampling requires a collector
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for OpenTelemetry Python.
Scores are editorial opinions as of 2026-03-06.