apiVersion: v1 kind: ConfigMap metadata: name: logs-overview-grafana-dashboard namespace: monitoring labels: grafana_dashboard: "1" data: logs-overview.json: | { "title": "Logs Overview", "uid": "logs-overview", "schemaVersion": 39, "time": { "from": "now-1h", "to": "now" }, "refresh": "30s", "templating": { "list": [ { "name": "datasource", "type": "datasource", "query": "loki", "current": {} }, { "name": "namespace", "type": "query", "datasource": { "type": "loki", "uid": "${datasource}" }, "query": "label_values(namespace)", "refresh": 2, "includeAll": true, "multi": true, "current": { "text": "All", "value": "$__all" } } ] }, "panels": [ { "id": 1, "title": "Log-Volumen nach Namespace", "type": "timeseries", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 0 }, "targets": [ { "expr": "sum by (namespace) (count_over_time({namespace=~\"$namespace\"}[$__interval]))", "legendFormat": "{{namespace}}", "refId": "A" } ] }, { "id": 2, "title": "Errors / Crashes / Panics", "type": "logs", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 10, "w": 24, "x": 0, "y": 8 }, "options": { "showTime": true, "showLabels": true, "sortOrder": "Descending" }, "targets": [ { "expr": "{namespace=~\"$namespace\"} |~ \"(?i)error|panic|fatal|crashloopbackoff|exception\"", "refId": "A" } ] }, { "id": 3, "title": "Alle Logs (gefiltert nach Namespace)", "type": "logs", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 10, "w": 24, "x": 0, "y": 18 }, "options": { "showTime": true, "showLabels": true, "sortOrder": "Descending" }, "targets": [ { "expr": "{namespace=~\"$namespace\"}", "refId": "A" } ] } ] }