Alerts are not working as expected due to a possible bug with data being converted to milliseconds (epoch) by the graph panel.
SUM() function seems to return the sum of all data points instead of last 1 hour value. It seems to be a but with epoch converted to milliseconds by graph panel.
Version 5.2.1
POSTGRESQL
Ubuntu 18.04
Issue :
I have setup a graph panel with timeseries data, everything looks fine here and data is plotted accurately however when I setup the alert with sum(A, 1h, now) - it always returns the total sum of all data points instead of last 1 hour, when analysed the data is listed in millseconds on the alerts tab same as on graph panel but doesnt seem to work on alert.
What was the expected result?
I expect the SUM() function to show the total of values within the time range.
What happened instead?
the SUM() function returns value of all the data points
4623 instead of much lower value for last 1 hour data.
{“message”:“Condition[0]: Eval: true, Metric: failures, Value: 4623.000”,“data”:null}
{“firing”:true,“state”:“alerting”,“conditionEvals”:“true = true”,“timeMs”:“620.846ms”,“matches”:[{“metric”:“failures”,“value”:4623}],“logs”:[{“message”:“Condition[0]: Query Result”,“data”:[{“name”:“failures”,“points”:[[106,1532300400000],[118,1532302200000],[132,1532304000000],[111,1532305800000],[112,1532307600000],[109,1532309400000],[116,1532311200000],[122,1532313000000],[106,1532314800000],[111,1532316600000],[107,1532318400000],[122,1532320200000],[107,1532322000000],[117,1532323800000],[130,1532325600000],[130,1532327400000],[331,1532329200000],[268,1532331000000],[178,1532332800000],[173,1532334600000],[160,1532336400000],[176,1532338200000],[170,1532340000000],[132,1532341800000],[160,1532343600000],[150,1532345400000],[154,1532347200000],[164,1532349000000],[159,1532350800000],[158,1532352600000],[166,1532354400000],[68,1532356200000]]}]},{“message”:“Condition[0]: Eval: true, Metric: failures, Value: 4623.000”,“data”:null}]}
A similar issue was raised here however the last bit wasnt answered. “For instance Count/Sum() Query (A,5m,now) counts or sums the value of the entire table instead of the ones within the time frame”.