What Grafana is (in one minute)
<strong>Grafana</strong> is a UI for <strong>observability</strong>.
- It <strong>shows graphs</strong> (dashboards) for time-series data.
- It <strong>creates alerts</strong> when metrics cross thresholds.
- It can also display logs and traces depending on your setup.
Important: Grafana does not “monitor” by itself.
- Something else must <strong>collect metrics/logs/traces</strong> (commonly <strong>Prometheus</strong>, <strong>Loki</strong>, <strong>Tempo</strong>).
- Grafana then <strong>queries</strong> those data sources and renders dashboards.
If you remember one rule: > <strong>Metrics come from somewhere; Grafana only visualizes them.</strong>
The 3 building blocks you’ll see everywhere
1) Data source
A connection Grafana uses to fetch data. Common beginners’ choices:
- <strong>Prometheus</strong>: metrics (CPU, memory, request latency)
- <strong>Loki</strong>: logs
- <strong>Tempo</strong>: traces
2) Dashboard
A collection of panels.
- A <strong>panel</strong> = one chart/table
- A <strong>dashboard</strong> = many panels + layout + shared filters (variables)
3) Alerting
Rules that evaluate queries over time and notify you. Typical workflow:
- Query metric in a panel
- Convert query into an alert rule
- Choose conditions + duration + notification channel
Core monitoring mental model (beginner edition)
Your system has these “symptoms.” Monitoring should help you answer:
- <strong>Is it healthy?</strong> (up/down, error rates, latency)
- <strong>Is it getting worse?</strong> (trends + change detection)
- <strong>Why is it failing?</strong> (logs + traces + related metrics)
- <strong>What should I do next?</strong> (alerts with actionable context)
Grafana helps mainly with (1) and (2), while logs/traces help with (3).
What metrics should you start with?
Start small. Beginners often graph everything and learn nothing.
Service-level (the “must have” set)
For each service / API:
- <strong>Request rate</strong> (requests/sec)
- <strong>Error rate</strong> (4xx/5xx per second)
- <strong>Latency</strong> (p50/p95/p99; or at least average + max)
Resource-level (infrastructure health)
- <strong>CPU usage</strong>
- <strong>Memory usage</strong> (watch for OOM risk)
- <strong>Disk usage</strong> (and disk I/O)
- <strong>Network throughput / drops</strong>
Dependency-level (where failures spread)
- Database latency + error rate
- Cache hit rate + errors
- Queue depth / consumer lag (if you have async jobs)
Dashboards: how to build one that beginners can actually use
Panel types that are most useful early
- <strong>Time series line chart</strong>: latency, CPU, memory
- <strong>Single stat / gauge</strong>: current error rate or p95 latency
- <strong>Heatmap (optional)</strong>: request patterns by hour/region
- <strong>Table</strong>: top slow endpoints, top erroring instances
Use variables (but don’t overdo it)
Grafana variables help you filter by:
- environment: dev/stage/prod
- service name
- region / cluster
Beginner tip:
- Create <strong>one dashboard per system</strong>, not per chart.
- Add variables only after you have 3–6 solid panels.
Alerts: the rules of thumb that prevent noisy chaos
1) Alert on “badness,” not raw numbers
Instead of alerting on:
- CPU > 90%
Alert on:
- requests failing
- p95 latency too high
- error rate increasing
CPU is useful, but it’s often a symptom.
2) Always include a time window
A common mistake:
- “If metric crosses threshold, alert instantly”
Better:
- “If it stays bad for <strong>N minutes</strong>”
This reduces false alarms from brief spikes.
3) Add hysteresis using separate thresholds (if needed)
For example:
- Alert when p95 latency > 500ms
- Resolve when p95 latency < 350ms
This prevents alert flapping.
4) Use cardinality responsibly
If your metric has labels like:
- <code>pod</code>, <code>instance</code>, <code>userId</code>
Alerts can explode into thousands of rules. Beginner rule:
- Alert using labels that identify <strong>the service/cluster</strong>, not the individual request/user.
Common Grafana + Prometheus beginner pitfalls
Pitfall A: Averaging latency hides pain
Average latency can look fine while p95/p99 explode. Fix:
- Track <strong>p95/p99</strong> (or whatever percentile your app supports)
Pitfall B: “Dashboard looks good” ≠ “Production is fine”
Dashboards are passive. Fix:
- Add alerts for the metrics you care about.
Pitfall C: Too many dashboards
When everything is on a dashboard, nothing is actionable. Fix:
- Make one <strong>“system overview”</strong> dashboard.
- Make smaller <strong>“deep dive”</strong> dashboards only when you need them.
Pitfall D: No correlation
A graph alone rarely tells you the cause. Fix:
- Keep consistent labels (service name, environment)
- Link from Grafana panels to logs/traces
---
A practical starter checklist (Day 1 → Day 7)
Day 1: Set up data source
- Confirm Prometheus/Loki/Tempo is reachable
- Add Grafana data source
Day 2: Build an overview dashboard
- Request rate
- Error rate
- p95 latency
Day 3: Add resource panels
- CPU
- Memory
Day 4: Add dependency panels
- DB latency/errors
- Cache hit rate
Day 5: Add one “golden alert”
- Example: error rate > 1% for 5 minutes
Day 6: Add one “performance alert”
- Example: p95 latency > threshold for 10 minutes
Day 7: Add links to logs/traces
- So you can debug fast when alerts fire
How to name things so your future self doesn’t suffer
Use consistent names:
- Services: <code>orders-api</code>, <code>payments-api</code>
- Environments: <code>prod</code>, <code>staging</code>
- Metrics: include units when possible (<code>http_request_duration_ms</code>)
Dashboards:
- Start with the system name
- Example: “Orders Service / Overview”
Minimal example: what an alert should look like
A good alert has:
- <strong>Query</strong>: the data you evaluate
- <strong>Condition</strong>: threshold + operator
- <strong>Duration</strong>: “for 5m/10m”
- <strong>Severity</strong>: warning vs critical
- <strong>Message</strong>: who/what to do next
Beginner message template:
- “High error rate detected in <code>orders-api</code> on <code>prod</code>. Check recent deploys and logs for 5xx spikes.”
Final takeaway
Grafana is where you turn raw metrics into decisions. If you start with:
- a small set of service metrics (rate, errors, latency)
- a focused dashboard
- a couple of good alerts (with time windows)
…you will already be doing “real monitoring,” not just making charts.