Files
homelab-gitops/apps/minecraft-paper/dashboard.yaml
T

29 lines
2.9 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: paper-dashboard
labels:
grafana_dashboard: '1'
data:
paper.json: |
{
"uid": "mc-paper-homelab",
"title": "Minecraft — Paper",
"tags": ["minecraft", "paper"],
"schemaVersion": 39,
"version": 1,
"refresh": "30s",
"time": {"from": "now-3h", "to": "now"},
"panels": [
{"id": 1, "type": "stat", "title": "Server status", "gridPos": {"x": 0, "y": 0, "w": 4, "h": 4}, "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "targets": [{"refId": "A", "expr": "max(minecraft_status_healthy{namespace=\"mcserver\"})", "instant": true}]},
{"id": 2, "type": "gauge", "title": "Players online", "gridPos": {"x": 4, "y": 0, "w": 5, "h": 4}, "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "targets": [{"refId": "A", "expr": "max(minecraft_status_players_online_count{namespace=\"mcserver\"})", "instant": true}], "fieldConfig": {"defaults": {"min": 0, "max": 20, "unit": "short"}}},
{"id": 3, "type": "stat", "title": "Node", "gridPos": {"x": 9, "y": 0, "w": 7, "h": 4}, "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "targets": [{"refId": "A", "expr": "max by (node) (kube_pod_info{namespace=\"mcserver\",pod=~\"paper-.*\"})", "instant": true, "legendFormat": "{{node}}"}]},
{"id": 4, "type": "timeseries", "title": "CPU cores", "gridPos": {"x": 0, "y": 4, "w": 12, "h": 8}, "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "targets": [{"refId": "A", "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"mcserver\",pod=~\"paper-.*\",container=\"paper\"}[5m]))", "legendFormat": "CPU cores"}], "fieldConfig": {"defaults": {"unit": "cores", "min": 0}}},
{"id": 5, "type": "timeseries", "title": "Memory", "gridPos": {"x": 12, "y": 4, "w": 12, "h": 8}, "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "targets": [{"refId": "A", "expr": "sum(container_memory_working_set_bytes{namespace=\"mcserver\",pod=~\"paper-.*\",container=\"paper\"})", "legendFormat": "Working set"}], "fieldConfig": {"defaults": {"unit": "bytes", "min": 0}}},
{"id": 6, "type": "timeseries", "title": "Network", "gridPos": {"x": 0, "y": 12, "w": 24, "h": 8}, "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "targets": [{"refId": "A", "expr": "sum by (pod) (rate(container_network_receive_bytes_total{namespace=\"mcserver\",pod=~\"paper-.*\"}[5m]))", "legendFormat": "{{pod}} receive"}, {"refId": "B", "expr": "sum by (pod) (rate(container_network_transmit_bytes_total{namespace=\"mcserver\",pod=~\"paper-.*\"}[5m]))", "legendFormat": "{{pod}} transmit"}], "fieldConfig": {"defaults": {"unit": "Bps", "min": 0}}}
],
"templating": {"list": [{"name": "DS_PROMETHEUS", "type": "datasource", "query": "prometheus", "label": "Prometheus", "current": {"text": "Prometheus", "value": "${DS_PROMETHEUS}"}, "hide": 0}]},
"annotations": {"list": []},
"links": []
}