OpenTelemetry Instrumentation for Python

0.61b0 · active · verified Sat Mar 28

Provides automatic instrumentation tools for OpenTelemetry in Python, enabling seamless tracing and monitoring of Python applications. Current version: 0.61b0. Release cadence: Regular updates with new features and support for additional Python versions.

Warnings

Install

Imports

Quickstart

Quickstart guide to instrumenting ASGI and WSGI applications using OpenTelemetry.

import os
from opentelemetry.instrumentation.asgi import AsgiInstrumentor
from opentelemetry.instrumentation.wsgi import WSGIInstrumentor

# Initialize instrumentation
AsgiInstrumentor().instrument()
WSGIInstrumentor().instrument()

# Your application code here
# For example, using ASGI:
# app = ...
# app.run()

# For WSGI:
# from wsgi_app import app
# app.run()

view raw JSON →