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

# Analytics Export

> Export Portkey analytics data to OpenTelemetry-compatible collectors for centralized observability

Portkey supports sending your Analytics data to OpenTelemetry (OTel) compatible collectors, allowing you to integrate Portkey's analytics with your existing observability infrastructure.

## Overview

While Portkey leverages Clickhouse as the primary Analytics Store for the Control Panel by default, enterprise customers can integrate Portkey's analytics data with their existing data infrastructure through OpenTelemetry.

This export focuses on **aggregated metrics and analytics data** such as:

* Request counts and latency metrics
* Token usage statistics
* Cost tracking data
* Error rates and status codes

<Note>
  For exporting complete request/response logs with full prompt and completion content, see [Complete Logs Export](/product/enterprise-offering/otel/complete-logs).
</Note>

## Configuration

Portkey supports pushing your analytics data to an OTel compatible endpoint. The following environment variables are needed for pushing to OTel:

```yaml theme={"system"}
OTEL_PUSH_ENABLED: true
OTEL_ENDPOINT: http://localhost:4318
OTEL_EXPORTER_OTLP_HEADERS: x-api-key=my-api-key,x-another-header=value
```

### Environment Variables

| Variable                     | Required | Description                                   |
| ---------------------------- | -------- | --------------------------------------------- |
| `OTEL_PUSH_ENABLED`          | Yes      | Set to `true` to enable analytics export      |
| `OTEL_ENDPOINT`              | Yes      | The OTLP endpoint URL                         |
| `OTEL_EXPORTER_OTLP_HEADERS` | No       | Comma-separated headers in `key=value` format |

### Resource Attributes

You can configure arbitrary resource attributes of the OTel logs by setting a comma-separated value for `OTEL_RESOURCE_ATTRIBUTES`:

```yaml theme={"system"}
OTEL_SERVICE_NAME: portkey-gateway
OTEL_RESOURCE_ATTRIBUTES: ApplicationShortName=gateway,AssetId=12323,deployment.service=production
```

| Variable                   | Description                                                        |
| -------------------------- | ------------------------------------------------------------------ |
| `OTEL_SERVICE_NAME`        | Service name for the telemetry data                                |
| `OTEL_RESOURCE_ATTRIBUTES` | Comma-separated key=value pairs for additional resource attributes |

### Experimental Gen AI OTEL Traces

You can push experimental traces directly to your specific OTEL target using the following configuration variables:

```yaml theme={"system"}
EXPERIMENTAL_GEN_AI_OTEL_TRACES_ENABLED: true
EXPERIMENTAL_GEN_AI_OTEL_EXPORTER_OTLP_ENDPOINT: http://localhost:4318
EXPERIMENTAL_GEN_AI_OTEL_EXPORTER_OTLP_HEADERS: x-api-key=my-api-key,x-another-header=value
EXPERIMENTAL_GEN_AI_OTEL_RESOURCE_ATTRIBUTES: ApplicationShortName=agent-test,AssetId=12323,deployment.service=production
```

| Variable                                          | Description                                                        |
| ------------------------------------------------- | ------------------------------------------------------------------ |
| `EXPERIMENTAL_GEN_AI_OTEL_TRACES_ENABLED`         | Set to `true` to enable experimental gen AI traces                 |
| `EXPERIMENTAL_GEN_AI_OTEL_EXPORTER_OTLP_ENDPOINT` | The OTLP endpoint URL for Gen AI Traces                            |
| `EXPERIMENTAL_GEN_AI_OTEL_EXPORTER_OTLP_HEADERS`  | Comma-separated headers in `key=value` format                      |
| `EXPERIMENTAL_GEN_AI_OTEL_RESOURCE_ATTRIBUTES`    | Comma-separated key=value pairs for additional resource attributes |

## Integration Options

Enterprise customers commonly use these analytics exports with:

* **Datadog**: Monitor and analyze your AI operations alongside other application metrics
* **AWS S3**: Store analytics data for long-term retention and analysis
* **Prometheus/Grafana**: Build custom dashboards and alerting
* **Splunk**: Integrate with existing SIEM infrastructure
* **Other OTel-compatible systems**: Any system that can ingest OpenTelemetry data

## Use Cases

This feature enables:

* Centralized observability across your entire tech stack
* Long-term storage of analytics data
* Custom analytics dashboards in your preferred tools
* Integration with existing alerting systems
* Compliance and audit trail requirements

## Getting Support

For additional assistance with setting up analytics data export:

* Join our [Discord community](https://portkey.sh/reddit-discord)
* Email us at [support@portkey.ai](mailto:support@portkey.ai)

Our team can help you with best practices for configuring your OTel collectors and integrating with your existing systems.
