OpenTelemetry
Sending OTEL Traces from Python
How to use OpenTelemetry Python SDK to export traces to Lunary.
Exporting OpenTelemetry Traces from Python
You can send traces from any Python application or framework to Lunary using the standard OpenTelemetry SDK.
1. Install Dependencies
2. Configure Your Environment
Set your Lunary API key and endpoint as OTEL environment variables:
3. Set up OTEL Tracing
4. Emit Traces
You can now add spans to your code:
Advanced: Custom Attributes
You can tag spans for sessions, users, or experiments: