Grafana Time Series Best Practices Prompt
Build readable time series panels — units, legends, axis scaling, fill / stack mode, overrides, color choices.
- Target user
- Engineers building time series panels
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior SRE who has refined time series panels for hundreds of dashboards — units, legend formatting, axis scale, fill mode. I will provide: - The metric and panel - Current symptom (unreadable, busy legend, wrong scale) Your job: 1. **Units**: - bytes, percent, seconds, RPS - Auto-scales (10000 → 10K) - Display nice values 2. **Legend**: - Display mode: list / table - Calcs: last / mean / max / min - Hide if too many series 3. **For y-axis**: - Auto-scale OR fixed min/max - Log scale for ratios - Hard min 0 for counts - Soft min/max 4. **For overrides**: - Per-series customization - Color by name - Different unit 5. **For stacking / fill**: - Stacked = sum across series - Useful for "100%" breakdowns - Opacity for area visualization 6. **For thresholds**: - Horizontal line at value - Color background - Reference SLO 7. **For null values**: - "Connect" lines across gaps - Or show as null (gap) 8. **For colors**: - Default palette (categorical) - Custom for brand - Color by status (red for bad) Mark DESTRUCTIVE: changing series colors mid-incident (confuses), removing units (mis-scale), unbounded auto-scale (small spikes look huge). --- Metric: [DESCRIBE] Current symptom: [DESCRIBE]
Why this prompt works
Time series panel basics matter. This prompt walks them.
How to use it
- Set units always.
- Tune legend for readability.
- Y-axis appropriate.
- Consistent colors across panels.
Patterns
Standard config
{
"type": "timeseries",
"title": "Request Rate by Service",
"targets": [{
"expr": "sum by (job)(rate(http_requests_total[5m]))",
"legendFormat": "{{job}}"
}],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"min": 0,
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 10,
"showPoints": "never",
"spanNulls": false
}
}
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": ["mean", "max", "lastNotNull"]
},
"tooltip": { "mode": "multi", "sort": "desc" }
}
}
Stacked area (100% breakdown)
{
"fieldConfig": {
"defaults": {
"custom": {
"stacking": { "mode": "percent" },
"fillOpacity": 70
}
}
}
}
Threshold line (SLO target)
{
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{ "value": null, "color": "green" },
{ "value": 0.999, "color": "red" }
]
},
"custom": {
"thresholdsStyle": { "mode": "line" }
}
}
}
}
Per-series override
{
"fieldConfig": {
"overrides": [
{
"matcher": { "id": "byRegexp", "options": "/error|fail/i" },
"properties": [
{ "id": "color", "value": { "mode": "fixed", "fixedColor": "red" } }
]
}
]
}
}
Common findings this catches
- Bytes shown as raw numbers → set unit.
- Stacked counter rates for “what’s the total” → correct.
- Stacked latencies for top-N → wrong story.
- Legend overlapping → table mode, fewer series.
- Auto-min makes spikes huge → min: 0.
- Connect nulls hides outage → spanNulls: false.
- Color collision when many series → curated palette.
When to escalate
- Dashboard standardization — viz guidelines.
- Color accessibility — UX.
- Complex multi-series visualization — design.
Related prompts
-
Grafana Panel Types Selection Prompt
Choose the right Grafana panel — timeseries vs stat vs gauge vs bar gauge vs heatmap vs table; visualization principles for each.
-
Grafana Stat Panels, Thresholds & SLA Visualization Prompt
Design stat panels with threshold colors, SLA compliance visualization, multi-value stat layouts.
-
Grafana Templating & Variables Design Prompt
Design Grafana variables — query variables, custom, interval, chained, multi-value, regex; debug missing values, slow load.