Python

Python observability with OpenTelemetry

Instrument your Python application with zero code changes using OpenTelemetry auto-instrumentation. Supports Flask, FastAPI, Django, and dozens of popular libraries out of the box.

Quick start

Up and running in minutes

1

Install the distro and bootstrap instrumentations

bash
pip install opentelemetry-distro opentelemetry-exporter-otlp

# Installs an instrumentation package for every supported library in your environment
opentelemetry-bootstrap -a install
2

Run under opentelemetry-instrument

bash
export OTEL_SERVICE_NAME="my-python-app"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.maple.dev"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer your-api-key"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production"

opentelemetry-instrument python app.py
What you get

Automatic instrumentation for Python

Flask/FastAPI routes

Automatic spans for every HTTP request with route, method, and status code attributes.

SQLAlchemy queries

Database query spans with statement text, connection details, and execution duration.

HTTP requests

Outgoing requests via urllib3 and the requests library traced with context propagation.

Redis calls

Redis command spans with operation type, key patterns, and response time.

Celery tasks

Distributed task spans that link producers and consumers across worker processes.

gRPC calls

Client and server gRPC spans with service, method, and status code attributes.

Live trace preview

See your Python traces

Trace: Python App
POST /api/orders
234ms
FastAPI middleware
8ms
sqlalchemy SELECT products
45ms
requests.get https://payment.api
156ms
Explore more

Other integrations

오늘 첫 트레이스를 확인하세요.

SDK를 추가하고 OTLP 익스포터를 Maple로 향하게 하면 트레이스가 도착합니다.

maple.dev: OpenTelemetry 위의 옵저버빌리티