k8s-grafana-troubleshooting
Grafana troubleshooting
Find out why Grafana does not start, does not show a datasource or dashboard, or shows no data, and propose a fix. Read first, ask before changing. Run the investigation commands freely. Run a command under an "Ask first" line only after the user approves that exact command; if your credentials do not allow it, give it to the user to run. Never run a "Proposed fix"; hand it to the user.
On Kubernetes, Grafana is usually provisioned: datasources and dashboard providers
are YAML files under /etc/grafana/provisioning/, and dashboards are JSON files, all
mounted from ConfigMaps. With the Grafana Helm chart (also inside kube-prometheus-stack)
a sidecar container copies ConfigMaps labelled grafana_dashboard or
grafana_datasource into the pod. With the grafana-operator, Grafana,
GrafanaDashboard and GrafanaDatasource resources do the same.
The commands use placeholders: monitoring (where Grafana runs), my-grafana (its
Deployment and Service), my-grafana-datasources and my-grafana-dashboards (its
ConfigMaps) and my-app (a dashboard). Replace them with the real names.