FEAT(grafana): export dashboards

- to JSON and use sidecar ConfigMaps
- Export 14 dashboards to JSON files
- Use kustomize configMapGenerator for dashboard ConfigMaps
- Enable Grafana sidecar to load dashboards from ConfigMaps
- Keep Longhorn and Traefik Official from grafana.com
This commit is contained in:
2026-01-04 16:37:03 +09:00
parent b7ac39d68c
commit 9583be9b46
16 changed files with 74624 additions and 38 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,284 @@
{
"__inputs": [
{
"description": "",
"label": "Loki",
"name": "DS_LOKI",
"pluginId": "loki",
"pluginName": "Loki",
"type": "datasource"
}
],
"__requires": [
{
"id": "grafana",
"name": "Grafana",
"type": "grafana",
"version": "7.1.0"
},
{
"id": "graph",
"name": "Graph",
"type": "panel",
"version": ""
},
{
"id": "logs",
"name": "Logs",
"type": "panel",
"version": ""
},
{
"id": "loki",
"name": "Loki",
"type": "datasource",
"version": "1.0.0"
}
],
"annotations": {
"list": [
{
"$$hashKey": "object:75",
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Log Viewer Dashboard for Loki",
"editable": false,
"gnetId": 13639,
"graphTooltip": 0,
"id": 7,
"iteration": 1608932746420,
"links": [
{
"$$hashKey": "object:59",
"icon": "bolt",
"includeVars": true,
"keepTime": true,
"tags": [],
"targetBlank": true,
"title": "View In Explore",
"type": "link",
"url": "/explore?orgId=1&left=[\"now-1h\",\"now\",\"Loki\",{\"expr\":\"{job=\\\"$app\\\"}\"},{\"ui\":[true,true,true,\"none\"]}]"
},
{
"$$hashKey": "object:61",
"icon": "external link",
"tags": [],
"targetBlank": true,
"title": "Learn LogQL",
"type": "link",
"url": "https://grafana.com/docs/loki/latest/logql/"
}
],
"panels": [
{
"aliasColors": {},
"bars": true,
"dashLength": 10,
"dashes": false,
"datasource": "Loki",
"fieldConfig": {
"defaults": {
"custom": {},
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 3,
"w": 24,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": false,
"linewidth": 1,
"nullPointMode": "null",
"percentage": false,
"pluginVersion": "7.1.0",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(count_over_time({job=\"$app\"} |= \"$search\" [$__interval]))",
"legendFormat": "",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:168",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
},
{
"$$hashKey": "object:169",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"datasource": "Loki",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 25,
"w": 24,
"x": 0,
"y": 3
},
"id": 2,
"maxDataPoints": "",
"options": {
"showLabels": false,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"targets": [
{
"expr": "{job=\"$app\"} |= \"$search\" | logfmt",
"hide": false,
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "",
"transparent": true,
"type": "logs"
}
],
"refresh": false,
"schemaVersion": 26,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {},
"datasource": "Loki",
"definition": "label_values(job)",
"hide": 0,
"includeAll": false,
"label": "App",
"multi": false,
"name": "app",
"options": [],
"query": "label_values(job)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "",
"value": ""
},
"hide": 0,
"label": "String Match",
"name": "search",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"skipUrlSync": false,
"type": "textbox"
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"hidden": false,
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Logs / App",
"uid": "sadlil-loki-apps-dashboard",
"version": 1
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -54,6 +54,18 @@ datasources:
jsonData: jsonData:
implementation: prometheus implementation: prometheus
# Sidecar for dashboard ConfigMaps
sidecar:
dashboards:
enabled: true
label: grafana_dashboard
labelValue: "1"
searchNamespace: grafana
folderAnnotation: grafana_folder
provider:
foldersFromFilesStructure: false
# Dashboards from grafana.com (only those not in ConfigMaps)
dashboardProviders: dashboardProviders:
dashboardproviders.yaml: dashboardproviders.yaml:
apiVersion: 1 apiVersion: 1
@@ -69,49 +81,13 @@ dashboardProviders:
dashboards: dashboards:
default: default:
# Node Exporter Full - 노드 상세 메트릭
node-exporter-full:
gnetId: 1860
revision: 37
datasource: Prometheus
# Kubernetes Namespaces
kubernetes-views-namespaces:
gnetId: 15758
revision: 35
datasource: Prometheus
# Kubernetes Pods
kubernetes-views-pods:
gnetId: 15761
revision: 28
datasource: Prometheus
# ArgoCD
argocd:
gnetId: 14584
revision: 1
datasource: Prometheus
# Loki Logs
loki-logs:
gnetId: 13639
revision: 2
datasource: Loki
# Longhorn Storage # Longhorn Storage
longhorn: longhorn:
gnetId: 16888 gnetId: 16888
revision: 9 revision: 9
datasource: Prometheus datasource: Prometheus
# MinIO - 수동 import 사용 (변수 자동 매핑 필요) # Traefik Official
# Cert-Manager traefik-official:
cert-manager:
gnetId: 11001
revision: 1
datasource: Prometheus
# CoreDNS
coredns:
gnetId: 14981
revision: 2
datasource: Prometheus
# Traefik
traefik:
gnetId: 17346 gnetId: 17346
revision: 9 revision: 9
datasource: Prometheus datasource: Prometheus

View File

@@ -3,3 +3,92 @@ kind: Kustomization
resources: resources:
- vault/grafana-admin-password.yaml - vault/grafana-admin-password.yaml
- ingress.yaml - ingress.yaml
configMapGenerator:
- name: grafana-dashboard-argocd
files:
- dashboards/argocd.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-cert-manager
files:
- dashboards/cert-manager.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-cloudnative-pg
files:
- dashboards/cloudnative-pg.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-coredns
files:
- dashboards/coredns.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-falco
files:
- dashboards/falco.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-k8s-global
files:
- dashboards/kubernetes-views-global.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-k8s-namespaces
files:
- dashboards/kubernetes-views-namespaces.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-k8s-pods
files:
- dashboards/kubernetes-views-pods.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-loki-logs
files:
- dashboards/loki-logs-app.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-loki-metrics
files:
- dashboards/loki-metrics.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-minio
files:
- dashboards/minio.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-node-exporter
files:
- dashboards/node-exporter-full.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-traefik
files:
- dashboards/traefik-custom.json
options:
labels:
grafana_dashboard: "1"
- name: grafana-dashboard-trivy
files:
- dashboards/trivy-operator.json
options:
labels:
grafana_dashboard: "1"
generatorOptions:
disableNameSuffixHash: true