To send OpenTelemetry metrics and traces generated by OpenLIT from your AI Application to Prometheus and Grafana Tempo, follow the below steps.

1. Configure OpenTelemetry Collector

Prometheus + Tempo requires an OpenTelemetry Collector to route metrics to Prometheus and traces to Tempo. Install OpenTelemetry Collector (if not already running) For detailed installation instructions, refer to the OpenTelemetry Collector Documentation. Configure the Collector
  1. Configure OTLP Receiver: Set up receiver on 0.0.0.0:4318 for HTTP and 0.0.0.0:4317 for gRPC.
  2. Define Exporters:
    • prometheusremotewrite for metrics → Prometheus
    • otlp for traces → Tempo
  3. Assign to Pipelines: Route metrics and traces to appropriate backends.

2. Instrument your application

For direct integration into your Python applications:
import openlit

openlit.init(
  otlp_endpoint="YOUR_OTELCOL_URL:4318"
)
Replace:
  1. YOUR_OTELCOL_URL:4318 with the HTTP endpoint of your OpenTelemetry Collector.
    • Example: http://127.0.0.1:4318 (for local collector)
    • Example: http://otel-collector.monitoring.svc.cluster.local:4318 (for Kubernetes)
Refer to the OpenLIT Python SDK repository for more advanced configurations and use cases.

3. Import the pre-built Dashboard

  1. Log into your Grafana Instance. To install Grafana, refer to the Official documentation.
  2. Add Data Sources: Make sure Prometheus and Tempo are added as data sources in Grafana. To add a new data source, follow the steps in the Official documentation.
  3. Import Dashboard: Once Prometheus and Tempo are available as data sources in Grafana:
    • Click Dashboards in the primary menu
    • Click New and select Import in the drop-down menu
    • Copy the dashboard JSON provided in the accordion below
    • Paste the dashboard JSON text directly into the text area
    • Click Import
    • Save the dashboard