Files
k8s-apps/grafana/dashboards.yaml
2026-04-01 14:09:41 +00:00

112 lines
2.9 KiB
YAML

#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,
"panels": [
{
"datasource": "Loki",
"gridPos": {
"h": 18,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showLabels": true,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": true
},
"targets": [
{
"datasource": "Loki",
"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"
],
"templating": {
"list": [
{
"name": "namespace",
"type": "query",
"datasource": "Loki",
"label": "Namespace",
"query": "label_values({source=\"kubernetes\"}, namespace)",
"refresh": 2,
"includeAll": true,
"allValue": ".*",
"multi": false,
"current": {
"text": "All",
"value": ".*"
}
},
{
"name": "pod",
"type": "query",
"datasource": "Loki",
"label": "Pod",
"query": "label_values({source=\"kubernetes\", namespace=~\"$namespace\"}, pod)",
"refresh": 2,
"includeAll": true,
"allValue": ".*",
"multi": false,
"current": {
"text": "All",
"value": ".*"
}
},
{
"name": "container",
"type": "query",
"datasource": "Loki",
"label": "Container",
"query": "label_values({source=\"kubernetes\", namespace=~\"$namespace\", pod=~\"$pod\"}, container)",
"refresh": 2,
"includeAll": true,
"allValue": ".*",
"multi": false,
"current": {
"text": "All",
"value": ".*"
}
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"title": "Kubernetes Logs",
"uid": "loki-kubernetes-logs",
"version": 3
}