Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
346 changes: 346 additions & 0 deletions modules/grafana-dashboards/alerts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
{
"uid": "alerts",
"title": "Alert overview",
"tags": ["homelab", "alerts"],
"timezone": "browser",
"editable": true,
"graphTooltip": 0,
"time": { "from": "now-6h", "to": "now" },
"refresh": "1m",
"schemaVersion": 39,
"templating": {
"list": [
{
"name": "ds",
"label": "Datasource",
"type": "datasource",
"query": "prometheus",
"hide": 0,
"current": {}
}
]
},
"panels": [
{
"id": 10,
"type": "text",
"title": "",
"gridPos": { "h": 3, "w": 24, "x": 0, "y": 0 },
"options": {
"mode": "markdown",
"content": "**Everything firing right now**, read from the `ALERTS` series Mimir's ruler writes back (same rules that feed the Discord Alertmanager). This is a read-only view — to **silence or ack**, go to Grafana → **Alerting → Silences** on the *Mimir Alertmanager* datasource. Grafana's native `alertlist` panel can't render an external Alertmanager, so this uses the `ALERTS` metric instead."
}
Comment on lines +29 to +32
},
{
"id": 1,
"type": "stat",
"title": "Firing — critical",
"gridPos": { "h": 4, "w": 6, "x": 0, "y": 3 },
"datasource": { "type": "prometheus", "uid": "${ds}" },
"fieldConfig": {
"defaults": {
"unit": "none",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "red", "value": 1 }
]
}
},
"overrides": []
},
"options": {
"reduceOptions": { "calcs": ["lastNotNull"] },
"graphMode": "none",
"colorMode": "background"
},
"targets": [
{
"refId": "A",
"expr": "count(ALERTS{alertstate=\"firing\",severity=\"critical\"}) or vector(0)",
"instant": true
}
]
},
{
"id": 2,
"type": "stat",
"title": "Firing — warning",
"gridPos": { "h": 4, "w": 6, "x": 6, "y": 3 },
"datasource": { "type": "prometheus", "uid": "${ds}" },
"fieldConfig": {
"defaults": {
"unit": "none",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "orange", "value": 1 }
]
}
},
"overrides": []
},
"options": {
"reduceOptions": { "calcs": ["lastNotNull"] },
"graphMode": "none",
"colorMode": "background"
},
"targets": [
{
"refId": "A",
"expr": "count(ALERTS{alertstate=\"firing\",severity=\"warning\"}) or vector(0)",
"instant": true
}
]
},
{
"id": 3,
"type": "stat",
"title": "Firing — total",
"gridPos": { "h": 4, "w": 6, "x": 12, "y": 3 },
"datasource": { "type": "prometheus", "uid": "${ds}" },
"fieldConfig": {
"defaults": {
"unit": "none",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "red", "value": 1 }
]
}
},
"overrides": []
},
"options": {
"reduceOptions": { "calcs": ["lastNotNull"] },
"graphMode": "none",
"colorMode": "background"
},
"targets": [
{
"refId": "A",
"expr": "count(ALERTS{alertstate=\"firing\"}) or vector(0)",
"instant": true
}
]
},
{
"id": 4,
"type": "stat",
"title": "Pending",
"gridPos": { "h": 4, "w": 6, "x": 18, "y": 3 },
"datasource": { "type": "prometheus", "uid": "${ds}" },
"fieldConfig": {
"defaults": {
"unit": "none",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 1 }
]
}
},
"overrides": []
},
"options": {
"reduceOptions": { "calcs": ["lastNotNull"] },
"graphMode": "none",
"colorMode": "background"
},
"targets": [
{
"refId": "A",
"expr": "count(ALERTS{alertstate=\"pending\"}) or vector(0)",
"instant": true
}
]
},
{
"id": 5,
"type": "table",
"title": "Firing alerts",
"gridPos": { "h": 13, "w": 24, "x": 0, "y": 7 },
"datasource": { "type": "prometheus", "uid": "${ds}" },
"fieldConfig": {
"defaults": { "mappings": [], "custom": { "align": "left" } },
"overrides": [
{
"matcher": { "id": "byName", "options": "Severity" },
"properties": [
{
"id": "mappings",
"value": [
{
"type": "value",
"options": {
"critical": { "text": "critical", "color": "red", "index": 0 },
"warning": { "text": "warning", "color": "orange", "index": 1 }
}
}
]
},
{ "id": "custom.cellOptions", "value": { "type": "color-background" } },
{ "id": "custom.width", "value": 110 }
]
},
{
"matcher": { "id": "byName", "options": "Alert" },
"properties": [{ "id": "custom.width", "value": 220 }]
},
{
"matcher": { "id": "byName", "options": "Host" },
"properties": [{ "id": "custom.width", "value": 170 }]
}
]
},
"options": {
"showHeader": true,
"cellHeight": "sm",
"footer": { "show": false }
},
"targets": [
{
"refId": "A",
"expr": "ALERTS{alertstate=\"firing\"}",
"instant": true,
"format": "table"
}
],
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Value": true,
"__name__": true,
"job": true,
"alertstate": true
},
"indexByName": {
"severity": 0,
"alertname": 1,
"instance": 2,
"name": 3,
"mountpoint": 4,
"zpool": 5,
"state": 6,
"device": 7,
"disk": 8
},
"renameByName": {
"severity": "Severity",
"alertname": "Alert",
"instance": "Host",
"name": "Unit",
"mountpoint": "Mount",
"zpool": "Pool",
"state": "State",
"device": "Device",
"disk": "Disk"
}
}
},
{
"id": "sortBy",
"options": {
"fields": {},
"sort": [
{ "field": "Severity" },
{ "field": "Host" }
]
}
}
]
},
{
"id": 6,
"type": "table",
"title": "Pending alerts (waiting on `for:`)",
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 20 },
"datasource": { "type": "prometheus", "uid": "${ds}" },
"fieldConfig": {
"defaults": { "mappings": [], "custom": { "align": "left" } },
"overrides": [
{
"matcher": { "id": "byName", "options": "Severity" },
"properties": [
{
"id": "mappings",
"value": [
{
"type": "value",
"options": {
"critical": { "text": "critical", "color": "red", "index": 0 },
"warning": { "text": "warning", "color": "orange", "index": 1 }
}
}
]
},
{ "id": "custom.cellOptions", "value": { "type": "color-background" } },
{ "id": "custom.width", "value": 110 }
]
}
]
},
"options": {
"showHeader": true,
"cellHeight": "sm",
"footer": { "show": false }
},
"targets": [
{
"refId": "A",
"expr": "ALERTS{alertstate=\"pending\"}",
"instant": true,
"format": "table"
}
],
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Value": true,
"__name__": true,
"job": true,
"alertstate": true
},
"indexByName": {
"severity": 0,
"alertname": 1,
"instance": 2
},
"renameByName": {
"severity": "Severity",
"alertname": "Alert",
"instance": "Host",
"name": "Unit",
"mountpoint": "Mount",
"zpool": "Pool",
"state": "State",
"device": "Device",
"disk": "Disk"
}
}
},
{
"id": "sortBy",
"options": {
"fields": {},
"sort": [{ "field": "Severity" }, { "field": "Host" }]
}
}
]
}
]
}
Loading