Grafana Dashboards
The fastest path from data to dashboard.
Step 1: Run Grafana
docker run -d -p 3000:3000 grafana/grafana
Open localhost:3000; log in as admin/admin.
Step 2: Connect Prometheus
- Configuration → Data Sources → Add data source → Prometheus.
- URL:
http://prometheus:9090(or wherever yours runs). - Save & Test should turn green.
Step 3: First panel
The first panel is the proof that data is flowing. Pick a metric you trust, write the simplest useful query, and confirm the line draws.
- Create. Dashboards, New, Add panel; pick the Prometheus data source from the dropdown.
- Query.
rate(http_requests_total[5m]); rate over a 5-minute window is the canonical request-rate query. - Title. Name it 'Request Rate'; future-you reads dashboards like dashboards, not like queries.
- Apply. Save the panel and the dashboard; bookmark the URL for the team channel.
Step 4: Variables and templating
Variables turn one dashboard into a template. Pick a label, parameterise the query, and one dashboard now serves every service in your stack.
- Define a variable. Dashboard settings, Variables, New; type 'Query'; data source Prometheus; query
label_values(http_requests_total, service). - Reference in panels.
rate(http_requests_total{service="$service"}[5m]); the dropdown drives every panel. - Multi-value. Allow multi-select to compare services side by side without authoring a second dashboard.
- Reuse. One templated dashboard beats fifty hand-rolled per-service dashboards; drift drops to zero.
Antipatterns
- Hardcoding service names. Variables defeat that.
- One dashboard per service. Templates over copy-paste.
- Default panel without thoughtful query. Misleading.
What to do this week
Three moves. (1) Run the tutorial end-to-end on your own laptop / sandbox. (2) Apply the pattern to one production workload. (3) Document the variations you needed; share with the team.