You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a metric that is only produced when a host is rebooted (so ideally not that frequently). The stat lands in VictoriaMetrics just fine, but when we attempt to query it, we get very confusing results.
We can see in one case (1 hour step) one of the result sets doesn't even appear! This seems like step handling in query_range isn't working correctly. I'm struggling to imagine why 9 values become over 12,000 values depending on the query step.
Speaking with @hagen1778 , it seems this is expected behavior in PromQL/MetricsQL. I suppose now I have to figure out how to properly represent this data for my users.
query_range does not return raw values. It returns N data points for that series, where N = time_range/step. So if you have a 1 real datapoint every minute, the query_range?step=10s&start=now()-60 will return 60/10=6 data points and /export will return only one datapoint.
The origin of such behaviour comes from pull model - Prometheus never provided a guarantee that metric will be scraped every 10s or so. Instead, Prometheus schedules the scrape job to execute when it is possible and there are resources to do so, but not frequently than scrape_interval. Because of that, scrapes with scrape_interval=10 may happen on 11th sec, then on 15th sec, and then on 11th sec again. But if you will plot such data it will look "strange". That's why originial implementation of query_range returned always perfectly aligned datapoints, where ephemeral data points were just repeating previous "real" datapoint in that data range
Describe the bug
This may be similar to #977
We have a metric that is only produced when a host is rebooted (so ideally not that frequently). The stat lands in VictoriaMetrics just fine, but when we attempt to query it, we get very confusing results.
Here is the raw incoming data for the metric:
And here are a few attempts of getting the data through the query endpoint:
We can see in one case (1 hour step) one of the result sets doesn't even appear! This seems like step handling in query_range isn't working correctly. I'm struggling to imagine why 9 values become over 12,000 values depending on the query step.
Version
Used command-line flags
The text was updated successfully, but these errors were encountered: