# Grafana & Prometheus

Spice Cloud can be monitored with Grafana using the [Metrics endpoint](https://docs.spice.ai/api/metrics) and a pre-built dashboard available in the [Spice repository](https://github.com/spiceai/spiceai/blob/trunk/monitoring/grafana-dashboard.json).

## Prometheus Configuration

Configure a Prometheus instance to scrape metrics from your Spice Cloud app:

```yaml
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: spiceai
    scheme: https
    metrics_path: /v1/metrics
    static_configs:
      - targets: ['<app-cname>.spiceai.io']
    headers:
      X-API-Key: <API_KEY>
```

Replace `<app-cname>` with your app's CNAME (e.g. `us-west-2-prod-aws-data`) and `<API_KEY>` with your [app API key](https://docs.spice.ai/portal/apps/api-keys).

## Import Grafana Dashboard

1. Navigate to **Dashboards** in Grafana and click **New** > **Import**
2. Copy the dashboard JSON from [`monitoring/grafana-dashboard.json`](https://raw.githubusercontent.com/spiceai/spiceai/trunk/monitoring/grafana-dashboard.json) into the import box
3. Click **Load**

The dashboard provides panels for system health, query performance, data acceleration, caching, AI/ML operations, and Flight protocol metrics.

## Grafana as a Query Tool

In addition to metrics monitoring, Grafana can query Spice Cloud data directly using the FlightSQL or Infinity plugins. See the [Grafana Integration](https://docs.spice.ai/integrations/grafana) guide for setup instructions.

See also:

* [Metrics API](https://docs.spice.ai/api/metrics) - Endpoint reference and full list of available metrics
* [Datadog](https://docs.spice.ai/monitoring/monitoring/datadog) - Alternative monitoring with Datadog
