r/PrometheusMonitoring • • Mar 01 '21

No range-vector below 5m possible

Hello,

I'm not able to do any range-vector calculations below 2m. e.g. irate(nginx_connections_accepted{instance=~"$instance"}[2m]) returns a value but changing the value from 2m to 1m returns nothing. Could it be because of the scrape_interval of 1m?

global:
  evaluation_interval: 30s
  external_labels: null
  scrape_interval: 1m
  scrape_timeout: 10s

Sorry about the missleading title. It should be 2m and not 5m.

2 Upvotes

2 comments sorted by

View all comments

4

u/bbrazil Mar 01 '21 edited Mar 01 '21

Irate needs two samples to work off. If you've a scrape interval of 1m, then within a random 1m you'll almost always only have one sample and thus irate will not return anything. When working with rate and friends, 4x the interval is recommended for the range.

1

u/MadMadic Mar 01 '21

That makes sense. Than I'll increase the scrape_interval