635 lines
19 KiB
JSON
635 lines
19 KiB
JSON
{
|
|
"apiVersion": "dashboard.grafana.app/v2",
|
|
"kind": "Dashboard",
|
|
"metadata": {
|
|
"name": "k3s-pro-logs",
|
|
"namespace": "default",
|
|
"uid": "4b031c52-1c0a-4a18-8f0e-0c8f3e7e6011",
|
|
"resourceVersion": "1786876489507019",
|
|
"generation": 1,
|
|
"creationTimestamp": "2026-08-16T10:34:49Z",
|
|
"labels": {
|
|
"grafana.app/deprecatedInternalID": "3770890413830144"
|
|
},
|
|
"annotations": {
|
|
"grafana.app/createdBy": "user:dfbtp4cn32dj4f",
|
|
"grafana.app/folder": "",
|
|
"grafana.app/saved-from-ui": "Grafana v13.1.1 (a9cee6e172)"
|
|
}
|
|
},
|
|
"spec": {
|
|
"annotations": [
|
|
{
|
|
"kind": "AnnotationQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "grafana",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "-- Grafana --"
|
|
},
|
|
"spec": {}
|
|
},
|
|
"enable": true,
|
|
"hide": true,
|
|
"iconColor": "rgba(0, 211, 255, 1)",
|
|
"name": "Annotations & Alerts",
|
|
"builtIn": true,
|
|
"legacyOptions": {
|
|
"type": "dashboard"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"cursorSync": "Crosshair",
|
|
"editable": true,
|
|
"elements": {
|
|
"panel-1": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 1,
|
|
"title": "Critical Events Over Time",
|
|
"description": "",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"editorMode": "code",
|
|
"expr": "sum(count_over_time({cluster=\"k3s-homeserver\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\"} !~ \"(?i)(No files matching import glob pattern|v1 Endpoints is deprecated)\" |~ \"(?i)(error|err|fatal|crit|fail|exception)\" [$__interval]))",
|
|
"legendFormat": "Errors",
|
|
"queryType": "range"
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
},
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"editorMode": "code",
|
|
"expr": "sum(count_over_time({cluster=\"k3s-homeserver\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\"} !~ \"(?i)(No files matching import glob pattern|v1 Endpoints is deprecated)\" |~ \"(?i)(warn|warning)\" [$__interval]))",
|
|
"legendFormat": "Warnings",
|
|
"queryType": "range"
|
|
}
|
|
},
|
|
"refId": "B",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "timeseries",
|
|
"version": "",
|
|
"spec": {
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"sum"
|
|
],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short",
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"value": null,
|
|
"color": "green"
|
|
},
|
|
{
|
|
"value": 80,
|
|
"color": "red"
|
|
}
|
|
]
|
|
},
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "bars",
|
|
"fillOpacity": 80,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "never",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "normal"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
"matcher": {
|
|
"id": "byName",
|
|
"options": "Errors"
|
|
},
|
|
"properties": [
|
|
{
|
|
"id": "color",
|
|
"value": {
|
|
"fixedColor": "red",
|
|
"mode": "fixed"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": {
|
|
"id": "byName",
|
|
"options": "Warnings"
|
|
},
|
|
"properties": [
|
|
{
|
|
"id": "color",
|
|
"value": {
|
|
"fixedColor": "orange",
|
|
"mode": "fixed"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"panel-2": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 2,
|
|
"title": "Top Error-Producing Pods",
|
|
"description": "",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"editorMode": "code",
|
|
"expr": "topk(5, sum by (pod) (count_over_time({cluster=\"k3s-homeserver\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\"} !~ \"(?i)(No files matching import glob pattern|v1 Endpoints is deprecated)\" |~ \"(?i)(error|err|fatal|crit|fail|exception)\" [$__range])))",
|
|
"legendFormat": "{{pod}}",
|
|
"queryType": "range"
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "bargauge",
|
|
"version": "10.4.0",
|
|
"spec": {
|
|
"options": {
|
|
"displayMode": "gradient",
|
|
"minVizHeight": 10,
|
|
"minVizWidth": 0,
|
|
"orientation": "horizontal",
|
|
"reduceOptions": {
|
|
"calcs": [
|
|
"lastNotNull"
|
|
],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"showUnfilled": true,
|
|
"text": {}
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short",
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"value": null,
|
|
"color": "green"
|
|
},
|
|
{
|
|
"value": 1,
|
|
"color": "orange"
|
|
},
|
|
{
|
|
"value": 10,
|
|
"color": "red"
|
|
}
|
|
]
|
|
},
|
|
"color": {
|
|
"mode": "thresholds"
|
|
}
|
|
},
|
|
"overrides": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"panel-3": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 3,
|
|
"title": "Live Pod Logs",
|
|
"description": "",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"editorMode": "code",
|
|
"expr": "{cluster=\"k3s-homeserver\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\"} !~ \"(?i)(No files matching import glob pattern|v1 Endpoints is deprecated)\" |~ \"$log_severity\" |~ \"$search\"",
|
|
"queryType": "range"
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "logs",
|
|
"version": "",
|
|
"spec": {
|
|
"options": {
|
|
"dedupStrategy": "exact",
|
|
"enableLogDetails": true,
|
|
"prettifyLogMessage": true,
|
|
"showCommonLabels": false,
|
|
"showLabels": true,
|
|
"showLogLabels": true,
|
|
"showTime": true,
|
|
"sortOrder": "Descending",
|
|
"wrapLogMessage": true
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {},
|
|
"overrides": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"layout": {
|
|
"kind": "RowsLayout",
|
|
"spec": {
|
|
"rows": [
|
|
{
|
|
"kind": "RowsLayoutRow",
|
|
"spec": {
|
|
"title": "Log Severity & Anomaly Overview",
|
|
"collapse": false,
|
|
"layout": {
|
|
"kind": "GridLayout",
|
|
"spec": {
|
|
"items": [
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"width": 16,
|
|
"height": 7,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 16,
|
|
"y": 0,
|
|
"width": 8,
|
|
"height": 7,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-2"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "RowsLayoutRow",
|
|
"spec": {
|
|
"title": "Filtered Container Log Stream",
|
|
"collapse": false,
|
|
"layout": {
|
|
"kind": "GridLayout",
|
|
"spec": {
|
|
"items": [
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"width": 24,
|
|
"height": 18,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-3"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"links": [],
|
|
"liveNow": false,
|
|
"preload": false,
|
|
"tags": [
|
|
"k3s",
|
|
"loki",
|
|
"logs",
|
|
"alloy"
|
|
],
|
|
"timeSettings": {
|
|
"timezone": "browser",
|
|
"from": "now-1h",
|
|
"to": "now",
|
|
"autoRefresh": "5s",
|
|
"autoRefreshIntervals": [
|
|
"5s",
|
|
"10s",
|
|
"30s",
|
|
"1m",
|
|
"5m",
|
|
"15m",
|
|
"30m",
|
|
"1h",
|
|
"2h",
|
|
"1d"
|
|
],
|
|
"hideTimepicker": false,
|
|
"fiscalYearStartMonth": 0
|
|
},
|
|
"title": "K3s Professional Log Analyzer",
|
|
"variables": [
|
|
{
|
|
"kind": "DatasourceVariable",
|
|
"spec": {
|
|
"name": "DS_LOKI",
|
|
"pluginId": "loki",
|
|
"refresh": "onDashboardLoad",
|
|
"regex": "",
|
|
"current": {
|
|
"text": "Loki",
|
|
"value": "Loki"
|
|
},
|
|
"options": [],
|
|
"multi": false,
|
|
"includeAll": false,
|
|
"label": "Loki Data Source",
|
|
"hide": "dontHide",
|
|
"skipUrlSync": false,
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "QueryVariable",
|
|
"spec": {
|
|
"name": "namespace",
|
|
"current": {
|
|
"text": "All",
|
|
"value": "$__all"
|
|
},
|
|
"label": "Namespace",
|
|
"hide": "dontHide",
|
|
"refresh": "onDashboardLoad",
|
|
"skipUrlSync": false,
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"__legacyStringValue": "label_values({cluster=\"k3s-homeserver\"}, namespace)"
|
|
}
|
|
},
|
|
"regex": "",
|
|
"sort": "alphabeticalAsc",
|
|
"definition": "label_values({cluster=\"k3s-homeserver\"}, namespace)",
|
|
"options": [],
|
|
"multi": true,
|
|
"includeAll": true,
|
|
"allValue": ".*",
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "QueryVariable",
|
|
"spec": {
|
|
"name": "pod",
|
|
"current": {
|
|
"text": "All",
|
|
"value": "$__all"
|
|
},
|
|
"label": "Pod",
|
|
"hide": "dontHide",
|
|
"refresh": "onDashboardLoad",
|
|
"skipUrlSync": false,
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"__legacyStringValue": "label_values({cluster=\"k3s-homeserver\", namespace=~\"$namespace\"}, pod)"
|
|
}
|
|
},
|
|
"regex": "",
|
|
"sort": "alphabeticalAsc",
|
|
"definition": "label_values({cluster=\"k3s-homeserver\", namespace=~\"$namespace\"}, pod)",
|
|
"options": [],
|
|
"multi": true,
|
|
"includeAll": true,
|
|
"allValue": ".*",
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "QueryVariable",
|
|
"spec": {
|
|
"name": "container",
|
|
"current": {
|
|
"text": "All",
|
|
"value": "$__all"
|
|
},
|
|
"label": "Container",
|
|
"hide": "dontHide",
|
|
"refresh": "onDashboardLoad",
|
|
"skipUrlSync": false,
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "loki",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "${DS_LOKI}"
|
|
},
|
|
"spec": {
|
|
"__legacyStringValue": "label_values({cluster=\"k3s-homeserver\", namespace=~\"$namespace\", pod=~\"$pod\"}, container)"
|
|
}
|
|
},
|
|
"regex": "",
|
|
"sort": "alphabeticalAsc",
|
|
"definition": "label_values({cluster=\"k3s-homeserver\", namespace=~\"$namespace\", pod=~\"$pod\"}, container)",
|
|
"options": [],
|
|
"multi": true,
|
|
"includeAll": true,
|
|
"allValue": ".*",
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "CustomVariable",
|
|
"spec": {
|
|
"name": "log_severity",
|
|
"query": "Warnings & Errors Only : (?i)(warn|warning|error|err|fatal|crit|fail|exception), Errors Only : (?i)(error|err|fatal|crit|fail|exception), All Logs (Including Info & Debug) : .*",
|
|
"current": {
|
|
"text": "Warnings & Errors Only",
|
|
"value": "(?i)(warn|warning|error|err|fatal|crit|fail|exception)"
|
|
},
|
|
"options": [
|
|
{
|
|
"selected": true,
|
|
"text": "Warnings & Errors Only",
|
|
"value": "(?i)(warn|warning|error|err|fatal|crit|fail|exception)"
|
|
},
|
|
{
|
|
"selected": false,
|
|
"text": "Errors Only",
|
|
"value": "(?i)(error|err|fatal|crit|fail|exception)"
|
|
},
|
|
{
|
|
"selected": false,
|
|
"text": "All Logs (Including Info & Debug)",
|
|
"value": ".*"
|
|
}
|
|
],
|
|
"multi": false,
|
|
"includeAll": false,
|
|
"label": "Log Severity Level",
|
|
"hide": "dontHide",
|
|
"skipUrlSync": false,
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "TextVariable",
|
|
"spec": {
|
|
"name": "search",
|
|
"current": {
|
|
"text": "",
|
|
"value": ""
|
|
},
|
|
"query": "",
|
|
"label": "Line Search Text",
|
|
"hide": "dontHide",
|
|
"skipUrlSync": false
|
|
}
|
|
}
|
|
]
|
|
}
|
|
} |