mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-30 08:36:55 +09:00
The Prometheus, Grafana and Loki templates installed but connected to nothing. A Grafana install now takes Metrics and Logs attachments: the panel creates the data source through Grafana's API with the recorded admin login, and a metrics attach also imports a dashboard of the panel's fleet metrics. An attached app joins the shared network, so Grafana reaches the source by name.
60 lines
2.3 KiB
JSON
60 lines
2.3 KiB
JSON
{
|
|
"uid": "serverkit-overview",
|
|
"title": "ServerKit servers",
|
|
"tags": ["serverkit"],
|
|
"timezone": "browser",
|
|
"schemaVersion": 39,
|
|
"refresh": "30s",
|
|
"time": {"from": "now-6h", "to": "now"},
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"name": "server",
|
|
"label": "Server",
|
|
"type": "query",
|
|
"datasource": {"type": "prometheus", "uid": "${DS_UID}"},
|
|
"query": "label_values(serverkit_server_up, server)",
|
|
"includeAll": true,
|
|
"multi": true,
|
|
"current": {"text": "All", "value": "$__all"},
|
|
"refresh": 2
|
|
}
|
|
]
|
|
},
|
|
"panels": [
|
|
{
|
|
"id": 1, "type": "stat", "title": "Servers online",
|
|
"gridPos": {"x": 0, "y": 0, "w": 6, "h": 4},
|
|
"datasource": {"type": "prometheus", "uid": "${DS_UID}"},
|
|
"targets": [{"refId": "A", "expr": "sum(serverkit_server_up{server=~\"$server\"})"}]
|
|
},
|
|
{
|
|
"id": 2, "type": "stat", "title": "Running containers",
|
|
"gridPos": {"x": 6, "y": 0, "w": 6, "h": 4},
|
|
"datasource": {"type": "prometheus", "uid": "${DS_UID}"},
|
|
"targets": [{"refId": "A", "expr": "sum(serverkit_containers_running{server=~\"$server\"})"}]
|
|
},
|
|
{
|
|
"id": 3, "type": "timeseries", "title": "CPU %",
|
|
"gridPos": {"x": 0, "y": 4, "w": 12, "h": 8},
|
|
"datasource": {"type": "prometheus", "uid": "${DS_UID}"},
|
|
"fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}, "overrides": []},
|
|
"targets": [{"refId": "A", "expr": "serverkit_cpu_percent{server=~\"$server\"}", "legendFormat": "{{server}}"}]
|
|
},
|
|
{
|
|
"id": 4, "type": "timeseries", "title": "Memory %",
|
|
"gridPos": {"x": 12, "y": 4, "w": 12, "h": 8},
|
|
"datasource": {"type": "prometheus", "uid": "${DS_UID}"},
|
|
"fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}, "overrides": []},
|
|
"targets": [{"refId": "A", "expr": "serverkit_memory_percent{server=~\"$server\"}", "legendFormat": "{{server}}"}]
|
|
},
|
|
{
|
|
"id": 5, "type": "timeseries", "title": "Disk %",
|
|
"gridPos": {"x": 0, "y": 12, "w": 24, "h": 8},
|
|
"datasource": {"type": "prometheus", "uid": "${DS_UID}"},
|
|
"fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}, "overrides": []},
|
|
"targets": [{"refId": "A", "expr": "serverkit_disk_percent{server=~\"$server\"}", "legendFormat": "{{server}}"}]
|
|
}
|
|
]
|
|
}
|