Spice can be monitored with Grafana (opens in a new tab) using the Spice Metrics Endpoint (opens in a new tab) and pre-built dashboards available in the Spice repository (opens in a new tab).
Navigate to the Dashboards section in Grafana and click "New" > "Import".
Copy the dashboard JSON from monitoring/grafana-dashboard.json (opens in a new tab) into the Grafana import box.
Click "Load".
View the Kubernetes (opens in a new tab) deployment guide for configuring the Prometheus Operator to scrape metrics from Spice pods (monitoring.podMonitor.enabled=true).
The dashboard Kubernetes Resource Utilization panels need cluster metrics in Prometheus (k8s_pod_cpu_usage, k8s_pod_memory_working_set, k8s_volume_capacity, k8s_volume_available with label k8s_pod_name). A common source is an OpenTelemetry Collector kubeletstats (opens in a new tab) receiver exporting those names (without unit suffixes). The scrape instance label should match the pod name so the Instances filter applies to those panels.
Configure a Prometheus instance to scrape metrics from the Spice runtimes.
This tutorial creates and configures Grafana and Prometheus locally to scrape and display metrics from several Spice instances. It assumes:
spiced-main and spiced-edge, are running on 127.0.0.1:9091 and 127.0.0.1:9092 respectively.Create a compose.yaml:
Create a prometheus.yaml to
Add a prometheus as a source to grafana. Create a .grafana/provisioning/datasources/prometheus.yml
Run the Docker Compose
Go to http://localhost:3000/dashboard/import and add the JSON from monitoring/grafana-dashboard.json (opens in a new tab).
The dashboard will have data from the Spice runtimes.
In addition to monitoring Spice with Grafana, you can query datasets served by Spice and visualize the results in Grafana panels using the Infinity data source (opens in a new tab), which can query Spice's HTTP SQL API (opens in a new tab).
Install the Infinity data source (opens in a new tab) plugin from the Grafana plugin catalog.
Add a new Infinity data source. No base URL or authentication is required at the data source level when targeting a Spice runtime that does not require an API key — credentials can be configured per query if needed (see API Auth (opens in a new tab)).
Create a panel backed by the Infinity data source and configure the query as an HTTP request against the Spice SQL endpoint:
Type: JSON
Method: POST
URL: http://localhost:8090/v1/sql
Headers: Content-Type: application/json
Body (raw):
The endpoint returns a JSON array of row objects (the default application/json response format), which Infinity parses directly into table rows for visualization.
:::note
The legacy spiceai-spicexyz-datasource Grafana plugin is no longer maintained and targets the earlier Spice.ai product, not the current runtime. Use the Infinity data source against the HTTP SQL API as shown above.
:::