Grafana Dashboards

💤0
Lv 10 XP
← 📊 Monitoring & Observability · Metrics & Dashboards

Grafana Dashboards

Beginner ⭐ 50 XP ⏱ 15 min #observability#grafana#dashboards

Visualize metrics and logs in Grafana dashboards and wire up alerts.

📖Theory

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.

🌍Real-World Example
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
✍️Hands-On Exercise
  1. Explain why Grafana is a visualization layer, not a database.
  2. Sketch three panels for a web service dashboard and their queries.
  3. Describe how a dashboard variable makes it reusable.
  4. How would you mark deployments on a graph?
🧾Cheat Sheet
ConceptDetail
Data sourcePrometheus, Loki, etc.
DashboardCollection of panels
PanelOne visualization + query
VariableReusable dashboard parameter
AnnotationMark events (deploys)
AlertingFire on query conditions
ProvisioningDashboards 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.

📚Official Documentation

📝 My notes on this topic

Auto-saves as you type