> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langtrace.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Elastic APM

> Langtrace and Elastic APM Integration Guide

## 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.

<img src="https://mintcdn.com/langtraceai-2/hZpPXosaHdgAfpXF/images/elastic/new/dashboard1.png?fit=max&auto=format&n=hZpPXosaHdgAfpXF&q=85&s=2df03dedbd812517e1034c16fa5cc5aa" alt="Elastic APM Dashboard Overview" width="3022" height="1658" data-path="images/elastic/new/dashboard1.png" />

## Environment Variables

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

```bash theme={null}
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"
```

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

  ```bash theme={null}
  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.
</Note>

## Additional Resources

* [Elastic APM Documentation](https://www.elastic.co/guide/en/apm/get-started/current/quick-start-overview.html)
* [Elastic Observability Documentation](https://www.elastic.co/guide/en/observability/current/index.html)
* [Langtrace AI Documentation](https://docs.langtrace.ai/)
* [Elastic Community](https://discuss.elastic.co/)
