I am trying to display minimum and maximum values of a temperature sensor.
But I am running into the following problem:
Lets say I select last 24 hours in the time range selector. The minimum temperature is 21 degree celcius. If I now select last 6 months in the time range selector I get 23 degree celcius as minimum value.
How is this possible? Shouldn’t be the minimum value in the 6 months range also 21 degree?
I think this is independent of the Grafana plugin and a general issue of checkmk and probably a general problem of resampling.
My theory is in order to minimize the data transferred between Checkmk and Grafana the number of data points transferred is limited. For this example we assume its 500 points.
So for the 24-hour time window would have bins of 2.88 minutes and the 6-month time window bins of 8.64 hours. For each bin the average temperature is calculated, and then the maximum/minimum of those 500 averaged points is used to display the maximum/minimum of the whole time window. You can imagine, that there is quite some temperature variation in the 8.64 hour bin and thus the true min/max value is lower/higher.
So the problem is, that the average is calculated first (by Checkmk), and then the min/max is computed (by Grafana). In order to have correct results, Checkmk should calculate the min/max, but then we would have to implement a special endpoint just for returning the min/max endpoint, and right now we have a general purpose metrics endpoint.
So maybe it would be enough to use the min/max aggregation function in the query editor in Grafana, while you make sure that only a single metric is returned, but I have currently no time to test this myself.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.