Operations 8 min read

Master Grafana Time Series Panel: From Basics to Advanced Configuration

This guide explains why Grafana’s Time Series panel is essential for proactive monitoring, walks through browser selection, PromQL queries, panel options such as titles, tooltips, legends, axes, graph styles, and provides a ready‑to‑use JSON configuration to visualize trends and detect anomalies.

Linux Ops Smart Journey
Linux Ops Smart Journey
Linux Ops Smart Journey
Master Grafana Time Series Panel: From Basics to Advanced Configuration

Why Time Series Is Grafana’s “Soul”?

Stat panels show the current state, but without a time dimension you cannot predict future problems. The Time Series panel visualizes metric values over time, revealing trends, patterns, cycles, and anomalies, turning blind monitoring into a predictive tool.

Key Questions Without a Time Dimension

Is a 90% CPU spike sudden or gradual?

Has a similar peak occurred before, and how long did it last?

Do memory and disk I/O change together with the peak?

Is the trend periodic (e.g., daily rush hour) or a one‑off event?

Configure Time Series Visualization in the Browser

Select the Time series visualization type in Grafana’s panel editor.

PromQL Settings

Metrics browser : write PromQL expressions to fetch the desired data.

Option.Legend : format the legend fields for clearer display.

Panel Options

Title : set a descriptive panel name, e.g., “Host Memory”.

Tooltip : choose multi mode to show values for all series on hover; set value sort order to descending.

Legend : toggle visibility, choose display mode (table), placement (right), and which calculations to show (max, mean, last non‑null).

Axis : set time zone to browser , choose Y‑axis placement (auto), and label the axis (e.g., “Host Memory Usage”).

Graph Styles : smooth line interpolation, line width 2, fill opacity 25, gradient mode opacity .

Standard Options : set unit to bytes and choose the Classic color palette.

JSON Configuration Example

{
  "datasource": {"uid": "${datasource}"},
  "fieldConfig": {
    "defaults": {
      "color": {"mode": "palette-classic"},
      "custom": {
        "axisLabel": "主机内存使用情况",
        "axisPlacement": "auto",
        "fillOpacity": 25,
        "gradientMode": "opacity",
        "lineInterpolation": "smooth",
        "lineWidth": 2
      },
      "unit": "bytes"
    },
    "overrides": [{
      "matcher": {"id": "byRegexp", "options": "/.*使用率/"},
      "properties": [
        {"id": "custom.axisPlacement", "value": "right"},
        {"id": "custom.axisLabel", "value": "主机内存使用率"},
        {"id": "unit", "value": "percentunit"}
      ]
    }]
  },
  "gridPos": {"h":9,"w":24,"x":0,"y":0},
  "options": {
    "legend": {
      "calcs": ["max","mean","lastNotNull"],
      "displayMode": "table",
      "placement": "right",
      "showLegend": true
    },
    "timezone": ["browser"],
    "tooltip": {"mode": "multi", "sort": "desc"}
  },
  "targets": [
    {"editorMode":"code","expr":"node_memory_MemTotal_bytes{instance=~\"$instance\"} - node_memory_MemFree_bytes{instance=~\"$instance\"} - (node_memory_Cached_bytes{instance=~\"$instance\"} + node_memory_Buffers_bytes{instance=~\"$instance\"} + node_memory_SReclaimable_bytes{instance=~\"$instance\"})","legendFormat":"{{instance}}","refId":"A"},
    {"editorMode":"code","expr":"(node_memory_MemTotal_bytes{instance=~\"$instance\"} - node_memory_MemFree_bytes{instance=~\"$instance\"} - (node_memory_Cached_bytes{instance=~\"$instance\"} + node_memory_Buffers_bytes{instance=~\"$instance\"} + node_memory_SReclaimable_bytes{instance=~\"$instance\"})) / node_memory_MemTotal_bytes{instance=~\"$instance\"}","legendFormat":"{{instance}}使用率","refId":"B"}
  ],
  "title": "主机内存",
  "type": "timeseries"
}

Conclusion

The Time Series panel is Grafana’s “eye of trends”. By mastering data handling, visual configuration, and multi‑metric correlation, you can shift from reactive “fire‑fighting” to proactive “fire‑prevention”.

MonitoringoperationsVisualizationPromQLtime seriesGrafana
Linux Ops Smart Journey
Written by

Linux Ops Smart Journey

The operations journey never stops—pursuing excellence endlessly.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.