Overview

Elastic APM is a powerful solution for monitoring the performance of your applications. As Elastic APM is OpenTelemetry (OTel) compatible by default, you can easily integrate it with Langtrace to monitor your LLM applications.

Environment Variables

Set up the following environment variables to enable OpenTelemetry tracing and send traces to Elastic APM:

export OTEL_EXPORTER_OTLP_ENDPOINT="https://abcd1234.apm.us-central1.gcp.cloud.es.io:443"  # Your Elastic OTEL endpoint
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <secret>"
export OTEL_RESOURCE_ATTRIBUTES="service.name=rag-app-demo,service.version=0.0.1,deployment.environment=production"

We support all OpenTelemetry environment variables. You can also use the legacy format:

export LANGTRACE_API_HOST="<https://your-elastic-apm-endpoint:443/v1/traces>"
export LANGTRACE_HEADERS="Authorization=Bearer your-elastic-apm-token"
export OTEL_SERVICE_NAME=your-elastic-service

For the OTEL_EXPORTER_OTLP_PROTOCOL, both grpc and http protocols are supported. Choose the one that best fits your infrastructure setup.

Additional Resources