Skip to content

Grafana Dashboards

PiVirt provides curated, pre-built Grafana dashboards for monitoring cluster topology, hypervisor resource saturation, VM performance, and storage pool throughput.

  1. Open Grafana web interface
  2. Navigate to Dashboards → Import
  3. Upload dashboard JSON file or enter dashboard ID
Terminal window
# Import dashboard
curl -X POST http://localhost:3000/api/dashboards/db \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GRAFANA_TOKEN" \
-d @pivirt-cluster-overview.json
values.yaml
grafana:
sidecar:
dashboards:
enabled: true
label: grafana_dashboard
searchNamespace: ALL
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'pivirt'
orgId: 1
folder: 'PiVirt'
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards/pivirt

Dashboard ID: 12345

Panels:

  • Cluster health status
  • Node count and status
  • VM count by status
  • CPU/Memory/Disk utilization
  • Network I/O
  • API request rate

Variables:

  • $cluster - Cluster name
  • $namespace - Namespace filter
  • $interval - Time interval

Dashboard ID: 12346

Panels:

  • VM CPU usage (per VM)
  • VM memory usage (per VM)
  • VM disk I/O (read/write)
  • VM network I/O (RX/TX)
  • VM status timeline
  • Top VMs by resource usage

Variables:

  • $namespace - Namespace filter
  • $vm - VM name filter
  • $interval - Time interval

Dashboard ID: 12347

Panels:

  • Storage pool capacity
  • Storage pool usage
  • Volume size and usage
  • IOPS (read/write)
  • Latency
  • Replication status

Variables:

  • $pool - Storage pool filter
  • $volume - Volume name filter
  • $interval - Time interval

Dashboard ID: 12348

Panels:

  • API request rate
  • API error rate
  • API latency (p50, p95, p99)
  • API request duration histogram
  • Top methods by latency
  • Error rate by method

Variables:

  • $method - API method filter
  • $status - Status code filter
  • $interval - Time interval
{
"dashboard": {
"id": null,
"uid": "pivirt-cluster-overview",
"title": "PiVirt Cluster Overview",
"tags": ["pivirt", "cluster"],
"timezone": "browser",
"panels": [
{
"id": 1,
"title": "Cluster Health",
"type": "stat",
"targets": [
{
"expr": "pivirt_cluster_node_count{status=\"ready\"}",
"legendFormat": "Ready Nodes"
}
],
"fieldConfig": {
"defaults": {
"thresholds": {
"steps": [
{"color": "red", "value": 0},
{"color": "yellow", "value": 2},
{"color": "green", "value": 3}
]
}
}
}
},
{
"id": 2,
"title": "VM Count",
"type": "stat",
"targets": [
{
"expr": "pivirt_cluster_vm_count{status=\"running\"}",
"legendFormat": "Running VMs"
}
]
},
{
"id": 3,
"title": "CPU Usage",
"type": "gauge",
"targets": [
{
"expr": "avg(pivirt_cluster_node_cpu_usage_percent)",
"legendFormat": "Avg CPU"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"max": 100
}
}
},
{
"id": 4,
"title": "Memory Usage",
"type": "gauge",
"targets": [
{
"expr": "avg(pivirt_cluster_node_memory_usage_percent)",
"legendFormat": "Avg Memory"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"max": 100
}
}
},
{
"id": 5,
"title": "VM Count by Status",
"type": "piechart",
"targets": [
{
"expr": "pivirt_cluster_vm_count",
"legendFormat": "{{status}}"
}
]
},
{
"id": 6,
"title": "Node CPU Usage",
"type": "timeseries",
"targets": [
{
"expr": "pivirt_cluster_node_cpu_usage_percent",
"legendFormat": "{{node}}"
}
]
}
],
"time": {
"from": "now-1h",
"to": "now"
},
"templating": {
"list": [
{
"name": "cluster",
"type": "query",
"query": "label_values(pivirt_cluster_node_count, cluster)",
"refresh": 1
},
{
"name": "namespace",
"type": "query",
"query": "label_values(pivirtd_vm_count, namespace)",
"refresh": 1
}
]
}
}
}
{
"dashboard": {
"id": null,
"uid": "pivirt-vm-performance",
"title": "VM Performance",
"tags": ["pivirt", "vm"],
"panels": [
{
"id": 1,
"title": "VM CPU Usage",
"type": "timeseries",
"targets": [
{
"expr": "pivirtd_vm_cpu_usage_percent{namespace=~\"$namespace\", vm=~\"$vm\"}",
"legendFormat": "{{vm}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"max": 100
}
}
},
{
"id": 2,
"title": "VM Memory Usage",
"type": "timeseries",
"targets": [
{
"expr": "pivirtd_vm_memory_usage_bytes{namespace=~\"$namespace\", vm=~\"$vm\"}",
"legendFormat": "{{vm}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
}
}
},
{
"id": 3,
"title": "VM Disk I/O",
"type": "timeseries",
"targets": [
{
"expr": "rate(pivirtd_vm_disk_read_bytes_total{namespace=~\"$namespace\", vm=~\"$vm\"}[5m])",
"legendFormat": "{{vm}} read"
},
{
"expr": "rate(pivirtd_vm_disk_write_bytes_total{namespace=~\"$namespace\", vm=~\"$vm\"}[5m])",
"legendFormat": "{{vm}} write"
}
],
"fieldConfig": {
"defaults": {
"unit": "Bps"
}
}
},
{
"id": 4,
"title": "VM Network I/O",
"type": "timeseries",
"targets": [
{
"expr": "rate(pivirtd_vm_network_rx_bytes_total{namespace=~\"$namespace\", vm=~\"$vm\"}[5m])",
"legendFormat": "{{vm}} RX"
},
{
"expr": "rate(pivirtd_vm_network_tx_bytes_total{namespace=~\"$namespace\", vm=~\"$vm\"}[5m])",
"legendFormat": "{{vm}} TX"
}
],
"fieldConfig": {
"defaults": {
"unit": "Bps"
}
}
},
{
"id": 5,
"title": "Top VMs by CPU",
"type": "bargauge",
"targets": [
{
"expr": "topk(10, pivirtd_vm_cpu_usage_percent)",
"legendFormat": "{{vm}}"
}
]
}
],
"templating": {
"list": [
{
"name": "namespace",
"type": "query",
"query": "label_values(pivirtd_vm_count, namespace)",
"refresh": 1
},
{
"name": "vm",
"type": "query",
"query": "label_values(pivirtd_vm_cpu_usage_percent{namespace=~\"$namespace\"}, vm)",
"refresh": 2,
"multi": true,
"includeAll": true
}
]
}
}
}
{
"templating": {
"list": [
{
"name": "cluster",
"type": "query",
"datasource": "Prometheus",
"query": "label_values(pivirt_cluster_node_count, cluster)",
"refresh": 1,
"sort": 1
},
{
"name": "namespace",
"type": "query",
"datasource": "Prometheus",
"query": "label_values(pivirtd_vm_count, namespace)",
"refresh": 1,
"sort": 1,
"multi": true,
"includeAll": true
},
{
"name": "interval",
"type": "interval",
"query": "1m,5m,15m,30m,1h",
"current": {
"text": "5m",
"value": "5m"
}
}
]
}
}
{
"alert": {
"name": "VM High CPU",
"conditions": [
{
"evaluator": {
"params": [90],
"type": "gt"
},
"operator": {"type": "and"},
"query": {
"params": ["A", "5m", "now"]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"frequency": "1m",
"handler": 1,
"message": "VM CPU usage > 90%",
"notifications": [
{"uid": "slack-alerts"}
]
}
}
/etc/grafana/provisioning/dashboards/pivirt.yml
apiVersion: 1
providers:
- name: 'PiVirt'
orgId: 1
folder: 'PiVirt'
type: file
disableDeletion: false
updateIntervalSeconds: 30
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards/pivirt
foldersFromFilesStructure: true
/etc/grafana/provisioning/datasources/prometheus.yml
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
  • Use template variables for filtering
  • Make dashboards reusable across clusters
  • Allow users to focus on specific resources
  • Group related panels
  • Use rows for logical separation
  • Keep dashboards focused
  • Default to 1h for operational dashboards
  • Use 24h for trend analysis
  • Allow users to adjust time range
  • Color-code panels based on thresholds
  • Make critical issues immediately visible
  • Use consistent color scheme
  • Add descriptions to panels
  • Document variables and filters
  • Include links to related documentation