This commit is contained in:
2026-03-13 17:56:17 +00:00
parent 38520c492d
commit 7cf2e82366

View File

@@ -39,3 +39,166 @@ spec:
prometheusType: Prometheus
prometheusVersion: 2.24.0
timeInterval: 30s
---
#Kubernetes dashboard from loki / alloy
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: loki-kubernetes-logs
namespace: grafana
spec:
instanceSelector:
matchLabels:
dashboards: grafana
json: |
{
"annotations": {
"list": []
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "PENDING"
},
"gridPos": {
"h": 18,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": true,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": true
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "PENDING"
},
"editorMode": "code",
"expr": "{source=\"kubernetes\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\"}",
"queryType": "range",
"refId": "A"
}
],
"title": "Kubernetes Logs",
"type": "logs"
}
],
"refresh": "10s",
"schemaVersion": 39,
"tags": [
"loki",
"kubernetes",
"logs"
],
"templating": {
"list": [
{
"current": {
"selected": true,
"text": ".*",
"value": ".*"
},
"datasource": {
"type": "loki",
"uid": "PENDING"
},
"hide": 0,
"includeAll": false,
"label": "Namespace",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"label": "namespace",
"stream": "{source=\"kubernetes\"}",
"type": 1
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
},
{
"current": {
"selected": true,
"text": ".*",
"value": ".*"
},
"datasource": {
"type": "loki",
"uid": "PENDING"
},
"hide": 0,
"includeAll": false,
"label": "Pod",
"multi": false,
"name": "pod",
"options": [],
"query": {
"label": "pod",
"stream": "{source=\"kubernetes\", namespace=~\"$namespace\"}",
"type": 1
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
},
{
"current": {
"selected": true,
"text": ".*",
"value": ".*"
},
"datasource": {
"type": "loki",
"uid": "PENDING"
},
"hide": 0,
"includeAll": false,
"label": "Container",
"multi": false,
"name": "container",
"options": [],
"query": {
"label": "container",
"stream": "{source=\"kubernetes\", namespace=~\"$namespace\", pod=~\"$pod\"}",
"type": 1
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Kubernetes Logs",
"uid": "loki-kubernetes-logs",
"version": 1,
"weekStart": ""
}