Skip to content
CloudOps
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeChatGPT

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

  1. Set units always.
  2. Tune legend for readability.
  3. Y-axis appropriate.
  4. 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

Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week