managarten/docker/grafana/dashboards/logs-explorer.json
Till JS 4a48182677 feat(monitoring): integrate Promtail for centralized log collection via Loki
Loki was already running but had no log shipper. Adds Promtail to collect
Docker logs from all 66 containers with automatic tier labeling (infra,
auth, core, app, matrix, games) and a Grafana Logs Explorer dashboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:22:44 +02:00

334 lines
7.7 KiB
JSON

{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
"id": 1,
"panels": [],
"title": "Overview",
"type": "row"
},
{
"datasource": { "type": "loki", "uid": "loki" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisLabel": "",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 80,
"stacking": { "group": "A", "mode": "normal" }
}
}
},
"gridPos": { "h": 6, "w": 12, "x": 0, "y": 1 },
"id": 2,
"title": "Log Volume by Tier",
"type": "timeseries",
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "sum by (tier) (count_over_time({tier=~\".+\"} [$__interval]))",
"refId": "A"
}
]
},
{
"datasource": { "type": "loki", "uid": "loki" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "bars",
"fillOpacity": 80,
"stacking": { "group": "A", "mode": "normal" }
}
}
},
"gridPos": { "h": 6, "w": 12, "x": 12, "y": 1 },
"id": 3,
"title": "Errors & Warnings",
"type": "timeseries",
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "sum by (level) (count_over_time({tier=~\".+\"} |~ \"(?i)(error|warn|fatal|panic)\" [$__interval]))",
"refId": "A"
}
]
},
{
"datasource": { "type": "loki", "uid": "loki" },
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 50 },
{ "color": "red", "value": 200 }
]
}
}
},
"gridPos": { "h": 6, "w": 6, "x": 0, "y": 7 },
"id": 4,
"title": "Errors (last 1h)",
"type": "stat",
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "sum(count_over_time({tier=~\".+\"} |~ \"(?i)(error|fatal|panic)\" [1h]))",
"refId": "A",
"instant": true
}
]
},
{
"datasource": { "type": "loki", "uid": "loki" },
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 100 },
{ "color": "red", "value": 500 }
]
}
}
},
"gridPos": { "h": 6, "w": 6, "x": 6, "y": 7 },
"id": 5,
"title": "Warnings (last 1h)",
"type": "stat",
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "sum(count_over_time({tier=~\".+\"} |~ \"(?i)warn\" [1h]))",
"refId": "A",
"instant": true
}
]
},
{
"datasource": { "type": "loki", "uid": "loki" },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "displayMode": "gradient", "showValue": "auto" }
}
},
"gridPos": { "h": 6, "w": 12, "x": 12, "y": 7 },
"id": 6,
"title": "Top 10 Noisiest Services",
"type": "barchart",
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "topk(10, sum by (service) (count_over_time({tier=~\".+\"} [1h])))",
"refId": "A",
"instant": true
}
]
},
{
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 13 },
"id": 10,
"panels": [],
"title": "Error Logs",
"type": "row"
},
{
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 14 },
"id": 11,
"title": "Errors across all services",
"type": "logs",
"options": {
"showTime": true,
"showLabels": true,
"showCommonLabels": false,
"wrapLogMessage": true,
"prettifyLogMessage": false,
"enableLogDetails": true,
"dedupStrategy": "none",
"sortOrder": "Descending"
},
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "{tier=~\".+\"} |~ \"(?i)(error|fatal|panic)\"",
"refId": "A"
}
]
},
{
"collapsed": true,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 24 },
"id": 20,
"panels": [
{
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 12, "w": 24, "x": 0, "y": 25 },
"id": 21,
"title": "Auth Service Logs",
"type": "logs",
"options": {
"showTime": true,
"showLabels": true,
"wrapLogMessage": true,
"enableLogDetails": true,
"sortOrder": "Descending"
},
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "{tier=\"auth\"}",
"refId": "A"
}
]
}
],
"title": "Auth Services",
"type": "row"
},
{
"collapsed": true,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 25 },
"id": 30,
"panels": [
{
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 12, "w": 24, "x": 0, "y": 26 },
"id": 31,
"title": "Core Service Logs",
"type": "logs",
"options": {
"showTime": true,
"showLabels": true,
"wrapLogMessage": true,
"enableLogDetails": true,
"sortOrder": "Descending"
},
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "{tier=\"core\"}",
"refId": "A"
}
]
}
],
"title": "Core Services (Sync, Search, Gateway)",
"type": "row"
},
{
"collapsed": true,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 26 },
"id": 40,
"panels": [
{
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 12, "w": 24, "x": 0, "y": 27 },
"id": 41,
"title": "Web App Logs",
"type": "logs",
"options": {
"showTime": true,
"showLabels": true,
"wrapLogMessage": true,
"enableLogDetails": true,
"sortOrder": "Descending"
},
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "{tier=\"app\"} | service =~ \"$service\"",
"refId": "A"
}
]
}
],
"title": "Web Apps",
"type": "row"
},
{
"collapsed": true,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 27 },
"id": 50,
"panels": [
{
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 12, "w": 24, "x": 0, "y": 28 },
"id": 51,
"title": "Matrix Stack Logs",
"type": "logs",
"options": {
"showTime": true,
"showLabels": true,
"wrapLogMessage": true,
"enableLogDetails": true,
"sortOrder": "Descending"
},
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "{tier=\"matrix\"}",
"refId": "A"
}
]
}
],
"title": "Matrix Stack",
"type": "row"
}
],
"refresh": "30s",
"schemaVersion": 39,
"tags": ["logs", "loki"],
"templating": {
"list": [
{
"current": { "selected": false, "text": "All", "value": "$__all" },
"datasource": { "type": "loki", "uid": "loki" },
"definition": "label_values(service)",
"includeAll": true,
"multi": true,
"name": "service",
"query": "label_values(service)",
"refresh": 2,
"type": "query"
},
{
"current": { "selected": false, "text": "All", "value": "$__all" },
"datasource": { "type": "loki", "uid": "loki" },
"definition": "label_values(tier)",
"includeAll": true,
"multi": true,
"name": "tier",
"query": "label_values(tier)",
"refresh": 2,
"type": "query"
}
]
},
"time": { "from": "now-1h", "to": "now" },
"timepicker": {},
"timezone": "browser",
"title": "Logs Explorer",
"uid": "logs-explorer",
"version": 1
}