OpenTelemetry Python
ActiveDescription
CNCF-hosted official Python implementation of OpenTelemetry, providing standardized APIs and SDKs for telemetry data collection (traces, metrics, logs) — the de facto standard for cloud-native application observability.
Key Features
- Unified telemetry API — Standardized interfaces for traces, metrics, and logs in one cohesive system
- Flexible SDK configuration — Sampling strategies, batch export, resource attributes, and advanced settings
- Rich exporter ecosystem — Built-in exporters for Jaeger, Prometheus, Zipkin, OTLP and more
- Automatic instrumentation — Auto-instrumentation for Flask, Django, requests, SQLAlchemy and other popular libraries
- OpenTelemetry specification — Fully compliant with OTEL spec, seamless multi-language ecosystem interoperability
- OpenSSF best practices — Regular security audits and dependency supply-chain assurance
Use Cases
Categories
Quick Start
# Install core packages
pip install opentelemetry-api opentelemetry-sdk
# Basic usage
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
provider = TracerProvider()
processor = SimpleSpanProcessor(ConsoleSpanExporter())
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
# Auto-instrumentation
pip install opentelemetry-instrumentation-flask opentelemetry-instrumentation-requests