Time series panel, legend and tooltips

Grafana · Essentials · 10 min

Time series is the default visualization and the one you will tune most; its options decide whether a graph is readable at a glance.

The Time series visualization draws every series the query returns against time. Its main option groups:

  • Graph styles: lines, bars or points; line width and interpolation (linear, smooth, step before/after, the right choice for counters that change in steps); fill opacity and gradient; show points auto/always/never.
  • Stack series: off, normal or 100%. Stacking only makes sense when the series add up to a meaningful total, like requests by status; never stack latencies.
  • Connect null values and Disconnect values: by default a gap in data is drawn as a gap, which is usually what you want, since it reveals missing scrapes.
  • Axis: placement left/right, soft min and max (axis grows beyond them if data does), log scale, and centered zero. Overrides let one series use the right axis, for example a request count next to a latency.
  • Thresholds can be drawn as lines or filled regions, which gives a visual SLO line.

The legend has a mode (list, table, hidden), a placement (bottom, right) and values: calculations such as Last, Max, Mean and Total appended per series, sortable in table mode. Clicking a series name isolates it; Ctrl/Cmd-click adds more. Legend templates such as {{instance}} (set on the query) decide the names.

Tooltip mode is single, all or hidden; in all mode you can sort by value, which is handy with many series. The dashboard-level Graph tooltip setting (Settings, General) switches on a shared crosshair or shared tooltip across every panel, so hovering one graph marks the same moment on all of them.

Example

{
  "type": "timeseries",
  "title": "Requests by status",
  "options": {
    "legend": {"displayMode": "table", "placement": "right",
               "calcs": ["mean", "max", "lastNotNull"]},
    "tooltip": {"mode": "multi", "sort": "desc"}
  },
  "fieldConfig": {
    "defaults": {
      "unit": "reqps",
      "custom": {
        "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1,
        "fillOpacity": 20, "stacking": {"mode": "normal"},
        "spanNulls": false, "axisSoftMin": 0
      }
    },
    "overrides": [
      {"matcher": {"id": "byRegexp", "options": "5.."},
       "properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "red"}}]}
    ]
  }
}

Remember

  • Stack only series that add up; keep gaps for missing data
  • Legend table mode with Last/Max/Mean turns a graph into a summary
  • Shared crosshair aligns hover across all panels

Watch out for

  • Switching on Connect null values everywhere, which hides scrape gaps and outages as smooth lines.

Check yourself

  1. Which series are safe to stack in a time series panel?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: grafana.com/docs/grafana/latest/panels-visualizations/visualizations/time-series/