feat(monitoring): Scrape node and pod metrics, add logs and Pi dashboards

This commit is contained in:
2026-10-10 12:56:21 +05:30
parent a3c15d1aaa
commit 27dc30693b
14 changed files with 2298 additions and 110 deletions
@@ -0,0 +1,213 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
grafana_dashboard: "1"
name: grafana-dashboard-http-requests
namespace: monitoring
data:
http-requests.json: |
{
"uid": "http-requests",
"title": "HTTP requests",
"editable": true,
"schemaVersion": 41,
"refresh": "",
"time": {
"from": "now-1h",
"to": "now"
},
"timezone": "browser",
"tags": [],
"templating": {
"list": []
},
"panels": [
{
"type": "timeseries",
"title": "Requests by host",
"id": 1,
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "loki",
"uid": "loki"
},
"expr": "sum by (RequestHost) (count_over_time({namespace=\"traefik\"} | json | __error__=\"\" | RequestHost != \"\" [$__auto]))",
"legendFormat": "{{RequestHost}}",
"queryType": "range"
}
],
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"fillOpacity": 80,
"showPoints": "never",
"stacking": {
"mode": "normal"
},
"drawStyle": "bars"
}
},
"overrides": []
}
},
{
"type": "timeseries",
"title": "Responses by status",
"id": 2,
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "loki",
"uid": "loki"
},
"expr": "sum by (DownstreamStatus) (count_over_time({namespace=\"traefik\"} | json | __error__=\"\" | RequestHost != \"\" [$__auto]))",
"legendFormat": "{{DownstreamStatus}}",
"queryType": "range"
}
],
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"fillOpacity": 80,
"showPoints": "never",
"stacking": {
"mode": "normal"
},
"drawStyle": "bars"
}
},
"overrides": []
}
},
{
"type": "timeseries",
"title": "p95 response time by host",
"id": 3,
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 8
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "loki",
"uid": "loki"
},
"expr": "quantile_over_time(0.95, {namespace=\"traefik\"} | json | __error__=\"\" | RequestHost != \"\" | unwrap Duration [$__auto]) by (RequestHost)",
"legendFormat": "{{RequestHost}}",
"queryType": "range"
}
],
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"fieldConfig": {
"defaults": {
"unit": "ns",
"custom": {
"fillOpacity": 10,
"showPoints": "never"
}
},
"overrides": []
}
},
{
"type": "logs",
"title": "Access log",
"id": 4,
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 16
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "loki",
"uid": "loki"
},
"queryType": "range",
"expr": "{namespace=\"traefik\"} | json | __error__=\"\" | RequestHost != \"\" | line_format \"{{.DownstreamStatus}} {{.RequestMethod}} {{.RequestHost}}{{.RequestPath}} {{div .Duration 1000000}}ms {{.ClientHost}}\""
}
],
"options": {
"showTime": true,
"wrapLogMessage": false,
"sortOrder": "Descending",
"enableLogDetails": true,
"dedupStrategy": "none",
"showLabels": false
}
}
],
"annotations": {
"list": []
}
}