Hi,
I'm still dealing with my issue of dealing with different resolution data and zoom and Prometheus data source in Grafana
For example I capture amount of Queries with 1 second resolution as I want to be able to see if there are some stalls couple of seconds in length, while when I'm looking at things like table sizes or access to individual tables I capture it with 1min resolution because capturing it with 1 second resolution would cause unreasonable overhead.
This causes to the bad problem with "zoomable graphs" where if I plot these values on the same graph together with 1 hour step over week I have both data shown, as I zoom in to the high level of details so go over 15min with 10sec step the low resolution data dissapears
I'm using rate(metric[$interval]) function to plot the data to make sure I'm computing the average over the proper resolution interval to avoid noise until I have zoomed in.
If I would use irate(metric[5m]) instead I can get both data points however it would be very volatile showing me for queries the QPS for random second every minute rather then average QPS for a given minute I would like to see.
The solution which looks like it would work is using rate if data is available with required resolution but using irate() when it is not. It is not mathematically perfect but much better than simply low resolution data disappearing,
So something like this would work:
ifnull(rate(metric[$interval]),irate(metric[5m])) which would use rate when it is available but irate if it does not.
Is there something like ifnull() function available in Prometheus or other syntax to achieve what I'm trying to do ?
Thanks!