Dashboards & Panels
Grafana: Dashboards & Panels Grafana is the leading open-source observability platform for visualizing metrics, logs, and traces. It connects to dozens of data …
Grafana: Dashboards & Panels
Grafana is the leading open-source observability platform for visualizing metrics, logs, and traces. It connects to dozens of data sources and organizes data into dashboards made of panels.
Core Concepts
Dashboard: collection of panels arranged in a grid — each saved as JSON, can be version-controlled
Panel: a single visualization unit — time series, stat, table, heatmap, bar chart, etc.
Data source: connection to a backend (Prometheus, Loki, InfluxDB, PostgreSQL, CloudWatch, etc.)
Variable: template variable that makes dashboards dynamic — dropdown to filter by host, service, namespace
Annotation: mark a point in time on panels — e.g., "deployment happened here"
Time range: global dashboard time picker — "Last 1h", "Last 24h", or custom
Panel Types
Time series: line/bar chart over time — default for metrics (CPU, memory, request rate)
Stat: single large number with sparkline — current value with optional threshold coloring
Gauge: circular progress indicator — fill % relative to min/max
Bar chart: compare values across categories at a point in time
Table: raw data in tabular format — supports pagination, sorting, column mapping
Heatmap: visualize distributions over time (e.g., request latency percentiles)
Logs: log lines from Loki — supports regex filtering, log context
Node Graph: visualize service dependency graphs (traces/APM)
Geomap: world map with data points — for geographic metrics
Dashboard Variables
Variables make dashboards reusable across environments/services.
Types:
Query — values come from a data source query (e.g., all hostnames from Prometheus label)
Custom — comma-separated static values
Interval — time interval ($__interval resolves to auto step)
Text box — free text input
Constant — hidden value (e.g., data source name)
Data source — select a data source dynamically
Example — Query variable for host selection:
Name: host
Query type: Label values
Label: instance
Data source: Prometheus
→ Creates a dropdown: $host = "web-01" | "web-02" | "db-01"
Using in panels: rate(http_requests_total{instance="${host}"}[5m])Dashboard JSON & Import/Export
# Export dashboard JSON
# Dashboard → Share → Export → Save to file (dashboard.json)
# Import from JSON
# + → Import → Upload JSON file or paste JSON or use Grafana.com ID
# Grafana.com dashboard library (thousands of community dashboards)
# Popular IDs:
# 1860 — Node Exporter Full (Linux system metrics)
# 3662 — Prometheus 2.0 Overview
# 13659 — Loki & Promtail logs
# 15489 — PostgreSQL overview
# 6417 — Kubernetes cluster monitoring