Core Concepts — The Car Dashboard Blueprint
Before the mechanic can install the dashboard, everyone needs to learn the vocabulary. Grafana has a small set of core concepts — once you understand these, every dashboard configuration makes sense.
The Big Picture
Data Sources — Where the Data Comes From
A Data Source is a connection to a monitoring system. Grafana doesn't collect data — it reads it from external sources.
| Data Source | What it provides |
|---|---|
| Prometheus | Metrics and time series |
| Loki | Logs |
| Tempo | Traces |
| Elasticsearch | Search and log analytics |
| InfluxDB | Time series metrics |
| MySQL/PostgreSQL | Relational data |
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
access: proxy
isDefault: true
Grafana is a visualization layer. It reads from data sources but doesn't store metrics. Think of it as the glass on the car dashboard — it displays data from the engine sensors.
Dashboards — The Instrument Cluster
A Dashboard is a collection of panels arranged in a grid. It's the full instrument cluster — speedometer, fuel gauge, temperature gauge, all in one place.
Each dashboard has:
- Panels — individual visualizations (graphs, gauges, tables)
- Rows — logical groupings of panels
- Variables — dropdowns that filter all panels
- Time range — the period being displayed
A dashboard is not a query. It's a collection of panels, each with its own query. The dashboard time range applies to all panels unless overridden.
Panels — The Individual Gauges
A Panel is a single visualization — a graph, gauge, stat, table, or text display. Each panel has its own PromQL query (or query from any data source).
| Panel Type | Best for | Example |
|---|---|---|
| Time series | Trends over time | CPU usage over 1 hour |
| Stat | Single current value | Current error count |
| Gauge | Value within a range | Memory usage (0-100%) |
| Table | Structured data | Top 10 slowest endpoints |
| Bar gauge | Comparing values | Requests per service |
| Heatmap | Distribution over time | Request latency distribution |
| Alert list | Active alerts | Current firing alerts |
Panel anatomy
Each panel consists of:
- Query — the PromQL (or SQL, etc.) expression
- Visualization — how to display the data
- Transformations — modify the data before display
- Alert — optional threshold-based alerting
One panel = one visualization. If you need to compare two metrics, use two panels or use a legend to show both lines in one graph.
Variables — The Dashboard Controls
Variables are dropdown menus that let you filter all panels on a dashboard. They're the controls on the car dashboard — select which lane, which engine, which time range.
templating:
list:
- name: instance
type: query
query: label_values(up, instance)
datasource: Prometheus
Now $instance can be used in any panel query:
rate(http_requests_total{instance="$instance"}[5m])
Variables make dashboards reusable. One dashboard with an instance variable works for every server.
Rows and Layout — Organizing the Dashboard
Rows group related panels visually. Click a row to collapse/expand it.
panels:
- title: Overview
type: row
collapsed: false
- title: CPU Usage
type: timeseries
gridPos: { h: 8, w: 12, x: 0, y: 1 } # half width, row 1
- title: Memory Usage
type: timeseries
gridPos: { h: 8, w: 12, x: 12, y: 1 } # half width, right side
- title: Request Rate
type: timeseries
gridPos: { h: 8, w: 24, x: 0, y: 9 } # full width, row 2
gridPos defines the panel position: h = height, w = width (out of 24), x = horizontal position, y = vertical position.
Annotations — Markers on the Timeline
Annotations are vertical markers on graphs that highlight specific events (deploys, incidents, maintenance).
annotations:
- name: Deployments
datasource: Prometheus
query: 'count_over_time(deployments_total[1m]) > 0'
Annotations correlate events with metrics. "The spike happened right after the deploy" becomes visible instantly.