I am using the new Unified Alerting platform.
Grafana version 8.5.3
Try to make an alert for every new row of data that arrives in my table/dashboard.
My query (A) looks as follows:
SELECT count(*) AS ‘aantal’
WHERE ((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(Tijdstip)) < (5 * 60))
I’m using expression (B) $A > 0 to get the final result: 0 or 1
Selecting ‘Stat’ button at ‘2 Create a query to be alerted on’ and ‘Run queries’ results in the expected count.
However after saving my query/alert rule ‘Stat’ seems to be changed in ‘Time series’.
This time running my query renders an error.
Is this a bug?
do you see any errors in your browser’s developer tools, or in the grafana server logs, when you run this?
try increasing the verbosity of the Grafana server logs to
debug and note any errors. For printing to console, set the console logs to
debug as well.
Set logging to debug.
In console nothing special.
In log two interesting lines:
After saving query:
- 2022-05-26 11:03:48 logger=sqlstore.transactions t=2022-05-26T11:03:48.51+0200 lvl=dbug msg=“skip committing the transaction because it belongs to a session created in the outer scope”
- 2022-05-26 11:04:03 logger=ngalert t=2022-05-26T11:04:03.92+0200 lvl=dbug msg=“alert rules fetched” count=1 disabled_orgs=“unsupported value type”
Seems saving defaults always to timeseries despite stat has been selected.
Message on screen:
Data is missing a time field