Skip to main content

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 SourceWhat it provides
PrometheusMetrics and time series
LokiLogs
TempoTraces
ElasticsearchSearch and log analytics
InfluxDBTime series metrics
MySQL/PostgreSQLRelational data
Grafana provisioning — add Prometheus as data source
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
access: proxy
isDefault: true
Remember

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
Remember

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 TypeBest forExample
Time seriesTrends over timeCPU usage over 1 hour
StatSingle current valueCurrent error count
GaugeValue within a rangeMemory usage (0-100%)
TableStructured dataTop 10 slowest endpoints
Bar gaugeComparing valuesRequests per service
HeatmapDistribution over timeRequest latency distribution
Alert listActive alertsCurrent firing alerts

Panel anatomy​

Each panel consists of:

  1. Query — the PromQL (or SQL, etc.) expression
  2. Visualization — how to display the data
  3. Transformations — modify the data before display
  4. Alert — optional threshold-based alerting
Remember

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.

Template variable — select a server
templating:
list:
- name: instance
type: query
query: label_values(up, instance)
datasource: Prometheus

Now $instance can be used in any panel query:

Use the variable in a query
rate(http_requests_total{instance="$instance"}[5m])
Remember

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.

Dashboard layout
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
Remember

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).

Annotation from Prometheus
annotations:
- name: Deployments
datasource: Prometheus
query: 'count_over_time(deployments_total[1m]) > 0'
Remember

Annotations correlate events with metrics. "The spike happened right after the deploy" becomes visible instantly.