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

# Configure metrics

Astro Private Cloud (APC) provides multiple options for collecting and exporting Airflow metrics including StatsD, OpenTelemetry (OTEL), and Prometheus integration.

## StatsD configuration (default)

StatsD resource limits are managed at the API level via `componentsConfig` and apply to all components — they can't be configured independently per component.

```yaml wrap theme={null}
resources:
  requests:
    cpu: "100m"
    memory: "384Mi"
  limits:
    cpu: "100m"
    memory: "384Mi"
```

### Airflow configuration

```ini wrap theme={null}
[metrics]
statsd_on = True
statsd_host = localhost
statsd_port = 8125
statsd_prefix = airflow
```

## Prometheus integration

```yaml wrap theme={null}
prometheus:
  enabled: true
  retention: 15d
  persistence:
    enabled: true
    size: 100Gi
```

## Grafana dashboards

Access Grafana at:

```text wrap theme={null}
https://grafana.<platform-domain>
```

Pre-built dashboards include:

* Airflow Dag performance
* Task execution metrics
* Scheduler health
* Worker utilization

## Alerting

```yaml wrap theme={null}
alertmanager:
  enabled: true
  config:
    route:
      receiver: 'platform'
    receivers:
      - name: 'platform'
        webhook_configs:
          - url: 'http://houston:8871/v1/alerts'
```

### Built-in alerts

* `AirflowDeploymentUnhealthy`
* `AirflowSchedulerUnhealthy`
* `AirflowTasksPendingIncreasing`

## Key metrics

| Metric                            | Description               |
| --------------------------------- | ------------------------- |
| `airflow_dagrun_duration_seconds` | Dag run duration          |
| `airflow_ti_successes`            | Successful task instances |
| `airflow_ti_failures`             | Failed task instances     |
| `airflow_scheduler_heartbeat`     | Scheduler health          |
| `airflow_executor_queued_tasks`   | Queued task count         |

## Best practices

* Set appropriate retention based on storage capacity.
* Use OTEL for multi-backend export.
* Configure alerts for critical health metrics.
* Monitor task queue depth for scaling needs.
