Pcornel
Observability

Grafana

Cheat sheet · https://pcornel.dk/topic.php?topic=6105

Back to the Topic

Answer

Grafana visualises data from many sources (Prometheus, Loki, Tempo, Elasticsearch, SQL) in dashboards, and can also run alert rules.

Remember

Provision dashboards and data sources as code. Use variables for environment/service. Explore view is the fastest way to test a query.

First checks

  • curl -s http://grafana:3000/api/health — first check for this topic
  • curl -s localhost:9090/-/ready — Prometheus ready
  • curl -s 'localhost:9090/api/v1/query?query=up' — scrape targets up/down
  • promtool check config prometheus.yml — config valid

Verify in this order

data source → query → panel → dashboard → user

Where it usually breaks

Failures include stale/wrong variables, mixed data sources, transformations hiding null/error series, time-range mismatch, unit/threshold mistakes and dashboard provisioning overwriting manual edits.

Grafana verification boundary matrix

BoundaryInspectHealthy interpretationDo not infer
IntentData sourcesIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeDashboards / Panels and variablesOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateTransformationsIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeAlertingThe original bounded check succeeds in the same time windowProduction correctness outside this scope

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6105

Confirmation

Confirm action

Continue?