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

# Export to Datadog

> Scrape Baseten metrics with an OpenTelemetry Collector and send them to Datadog.

Use an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) distribution that includes the Prometheus receiver and Datadog exporter, such as the contrib distribution. The receiver scrapes Baseten; the exporter sends those metrics to your Datadog account.

Create a [metrics-only API key](/observability/export-metrics/overview#create-a-metrics-api-key), then set these environment variables in the Collector's runtime:

<ParamField body="BASETEN_METRICS_API_KEY" type="string" required>
  The Baseten metrics-only API key.
</ParamField>

<ParamField body="DATADOG_API_KEY" type="string" required>
  An API key for the Datadog account that receives the metrics.
</ParamField>

<ParamField body="DATADOG_SITE" type="string" required>
  Your [Datadog site](https://docs.datadoghq.com/getting_started/site/), such as `datadoghq.com` or `datadoghq.eu`.
</ParamField>

Configure the Collector:

```yaml config.yaml theme={"system"}
receivers:
  # Configure a Prometheus receiver to scrape the Baseten metrics endpoint.
  prometheus:
    config:
      scrape_configs:
        - job_name: 'baseten'
          scrape_interval: 60s
          metrics_path: '/metrics'
          scheme: https
          authorization:
            type: Bearer
            credentials: ${env:BASETEN_METRICS_API_KEY}
          static_configs:
            - targets: ['app.baseten.co']
processors:
  batch:
exporters:
  # Configure a Datadog exporter.
  datadog:
    api:
      key: ${env:DATADOG_API_KEY}
      site: ${env:DATADOG_SITE}
service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [datadog]
```

Start the Collector with this configuration and check its logs for scrape or export errors. Search Datadog's Metrics Explorer for the exported Baseten metrics.

Keep all collectors within Baseten's [metrics rate limit](/observability/export-metrics/overview#rate-limit). See the [exported metrics reference](/observability/export-metrics/supported-metrics) for available measurements and the [Datadog exporter documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/datadogexporter) for exporter settings and batching guidance.
