Grafana Dashboards
Visualize metrics and logs in Grafana dashboards and wire up alerts.
Grafana is the visualization layer. It doesn’t store data — it connects to data sources (Prometheus, Loki, Elasticsearch, cloud monitors) and renders dashboards of panels (graphs, tables, stat tiles), each driven by a query.
Key features: variables make dashboards reusable across services/environments, annotations mark events like deploys, and Grafana alerting evaluates queries to fire notifications. You can import community dashboards by ID and version them as JSON in git.
Build a service dashboard:
Panel 1: Request rate → rate(http_requests_total[5m])
Panel 2: Error % → 5xx rate / total rate
Panel 3: p95 latency → histogram_quantile(0.95, …)
Variable: $service → reuse the dashboard per service
Annotation: deploys → mark releases on the timeline - Explain why Grafana is a visualization layer, not a database.
- Sketch three panels for a web service dashboard and their queries.
- Describe how a dashboard variable makes it reusable.
- How would you mark deployments on a graph?
Cheat Sheet▾
| Concept | Detail |
|---|---|
| Data source | Prometheus, Loki, etc. |
| Dashboard | Collection of panels |
| Panel | One visualization + query |
| Variable | Reusable dashboard parameter |
| Annotation | Mark events (deploys) |
| Alerting | Fire on query conditions |
| Provisioning | Dashboards as JSON in git |
Common Interview Questions▾
Does Grafana store metrics?
No — it’s a visualization and alerting layer that queries external data sources like Prometheus or Loki live. The data lives in those backends.
What makes a Grafana dashboard reusable across services?
Template variables: a dashboard parameterized by a $service (or $env) variable can display any service by switching the variable, instead of duplicating dashboards.