To send OpenTelemetry metrics and traces generated by OpenLIT from your LLM Application to Elastic, Follow the below steps.


Get your Elastic APM Credentials

  1. Sign in to your Elastc account.
  2. Open the side navigation and click on APM under Observability.
  3. Make sure the APM Server is running
  4. In the APM Agents section, Select OpenTelemetry and directly jump to Step 5 (Configure OpenTelemetry in your application):
  5. Copy and save the configuration value for OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS
    Replace the space after Bearer with %20: OTEL_EXPORTER_OTLP_HEADERS=“Authorization=Bearer%20[APIKEY]”

Add the following two lines to your application code:

import openlit



  1. YOUR_ELASTIC_OTEL_URL with the OTEL_EXPORTER_OTLP_ENDPOINT value you copied in Step 1.
  • Example -
  1. YOUR_ELASTIC_OTEL_AUTH with the OTEL_EXPORTER_OTLP_HEADERS value you copied in Step 1.
  • Example - Authorization=Bearer%20<APIKEY>

Refer to the OpenLIT Python SDK repository for more advanced configurations and use cases.


Import the pre-built Dashboard

  1. Copy the dashboard NDJSON provided in the accordion named Dashboard below and save it in a file (.ndjson).
  2. Log into your Elastic Instance.
  3. Go to Stack Management > Saved Objects.
  4. Click Import and upload your file containing the dashboard NDJSON.
  5. Click Import and you should have the dashboard available.