Use OpenTelemetry auto-instrumentation for Python so your app can send traces, metrics, and logs to Rocketlog without changing your code. You only set environment variables and run your app with the OpenTelemetry instrumenter.

Prerequisites

  • Python 3.8+
  • Your Rocketlog ingress endpoint: https://{your-ingress-endpoint}.rocketgraph.app

1. Install packages

Install the OpenTelemetry distro (SDK + auto-instrumentation) and OTLP exporter, then install instrumentations for common libraries:
pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
The bootstrap step installs instrumentation for libraries such as requests, flask, django, redis, psycopg2, and others. See OpenTelemetry Python automatic instrumentation for the full list.

2. Configure via environment variables

Point the OTLP exporter at your Rocketlog ingress and set your service name:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://{your-ingress-endpoint}.rocketgraph.app"
export OTEL_SERVICE_NAME="my-python-service"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_METRICS_EXPORTER="otlp"
export OTEL_LOGS_EXPORTER="otlp"
Replace {your-ingress-endpoint} with your actual Rocketlog ingress host (no path). The SDK will use the correct OTLP paths for traces, metrics, and logs.
Optional:
  • OTEL_EXPORTER_OTLP_PROTOCOL — Use http/protobuf (default for HTTP) or grpc depending on what your endpoint supports.
  • OTEL_RESOURCE_ATTRIBUTES — Add attributes like deployment.environment=production or k8s.pod.name=my-pod.

3. Run your application

Start your app with the OpenTelemetry instrumenter. It wraps your process and automatically captures spans, metrics, and logs from supported libraries:
opentelemetry-instrument python app.py
For a module:
opentelemetry-instrument python -m myapp
Your telemetry is sent to Rocketlog. In the dashboard, pick a time window to see traces, metrics, and logs and use AI root cause analysis.

Custom port or protocol

If your Rocketlog endpoint uses a non-default port or gRPC:
# HTTP/protobuf on default 4318
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"

# gRPC on default 4317
export OTEL_EXPORTER_OTLP_PROTOCOL="grpc"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://{your-ingress-endpoint}.rocketgraph.app:4317"

Next steps