From reading https://prometheus.io/docs/prometheus/latest/querying/basics/ a 'Range Vector Selectors' are defined as :
Range vector literals work like instant vector literals, except that they select a range of samples back from the current instant. Syntactically, a time duration is appended in square brackets ([]) at the end of a vector selector to specify how far back in time values should be fetched for each resulting range vector element.
In this example, we select all the values we have recorded within the last 5 minutes for all time series that have the metric name http_requests_total and a job label set to prometheus: http_requests_total{job="prometheus"}[5m]
I'm failing to understand how these selector's behave. My understanding of the query :
sum(rate(data_total[1h]))
is return the rate of change of the data_total
metric using a time during of 1h. Is this correct ? Is each point on the graph the sum(rate( of the previous hour ?
sum(rate(data_total[1h]))
:
From the above definition shouldn't 1h of data be displayed ? Instead may of hours of data are displayed :
Changing from 1h to 4h :
sum(rate(data_total[4h]))
:
renders :
Why has the shape changed when changing from [1h]
to [4h]
?