Downsample timeseries for Status History panel

  • What Grafana version and what operating system are you using?


  • What are you trying to achieve?

I want a status history panel showing pod readiness of k8s pods over time, but status history very quickly gets overloaded with too many values when increasing the time range. I want to downsample the rows, picking the min value over a time period relative to the total range.

  • How are you trying to achieve it?

I’ve tried using a query like min_over_time(kube_pod_container_status_ready{...}[$__interval]) but it doesn’t actually reduce the number of rows. If I look in the table view there’s still one row for every 15s (the scrape interval).

It got a bit better if I set Min step on the query to $__rate_interval, but it still explodes when going several days behind. Not even sure if setting that value is sane but it did reduce the rows.

  • What happened?

Too many rows makes status history sad

  • What did you expect to happen?

I expected min_over_time to actually reduce the number of rows so you got 1 row per time chunk you “min” over.

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

When increasing the time range:

Too many points to visualize properly.
Update the query to return fewer points.
(721 points received)
  • Did you follow any online instructions? If so, what is the URL?
1 Like

@gustaflindstedt what was your conclusion? I’m trying to wrap my head around the same problem :smiley:

For me the solution was to set explicit “Max data points” in Grafana → Panel → Query Options, to a number that provided full resolution in small time intervals (resulting in 1:1 resolution with scrape interval) and reasonable “buckets” in large intervals, downsampling the data. My “min interval” is set to same value as scrape interval.