Provisioning (as code)
Data sources, dashboards, and alerts are defined in files — reproducible, in git, not through clicking:
A dashboard is exported to JSON (Share → Export) and committed to the repository.
Visualizing metrics and logs — data sources, dashboards, variables, alerts.
systemctl status grafana-server
service status
ss -tlnp | grep 3000
is the web UI listening
sudo grafana-cli admin reset-admin-password <new-password>
sudo grafana-cli plugins install grafana-piechart-panel
sudo systemctl restart grafana-server
apply the plugin
Grafana draws dashboards from data sources (Prometheus,
Loki, Postgres, etc.). It doesn't store metrics itself — only queries and
visualizes them. The web UI is on :3000.
The flow: a data source → a panel with a query (PromQL/SQL) → a dashboard → (optionally) alerts.
http://prometheus:9090 → Save & Test.rate(http_requests_total[5m])) →
pick a visualization and units (Standard options → Unit).$instance, $job) — Settings → Variables → Query —
for filtering by host/service.Data sources, dashboards, and alerts are defined in files — reproducible, in git, not through clicking:
A dashboard is exported to JSON (Share → Export) and committed to the repository.
:9090/graph).$variable?sudo grafana-cli admin reset-admin-password <new-password> (or an
environment variable at startup).
If it wasn't provisioned, dashboards live in the database
(/var/lib/grafana/grafana.db). Back it up, or keep dashboards as code
(JSON in git plus provisioning).
Found an inaccuracy? Report an error in the article