Why does the 2nd query below return no data? Whereas by comparison the first returns data fine. Am I not able to use rate on multiple metrics like this? Thanks!
Ok - returns data:
Not ok - returns no data:
I believe I understand the issue now. There was a first problem of using 5m instead of 10m and not finding at least 2 data points in the 5 minute window to use to calculate the rate.
There was a second more subtle problem. Prometheus is discarding the name label when a rate on a metric is calculated. Because Prometheus considers that a rate is something different to the original metric (ie its a rate which is a new metric, which is different to the original metric). Because the name label was discarded, and in my case there were no other differences in the metric labels, it resulted in an error “vector cannot contain metrics with the same labelset”. Because after the name was stripped, the result set had metrics where all the labels were the same. Prometheus does not allow this.