Hello! I am enjoying my initial experience with Questdb using more natural SQL queries vs InfluxDB. However I have been struggling with Grafana Alerts using a Questdb datasource and hope you can help.
My initial aim is to send an alert from Grafana to Telegram if a device stops sending data to Questdb. A Tank1 datasource includes columns voltage and timestamp. In the QuestDb Web Console I have successfully tested this query to get the most recent 5 minutes of data:
SELECT voltage, timestamp FROM "tank1" WHERE (timestamp > dateadd('m', -5, now())) ORDER BY timestamp DESC;
If I stop the datasource logging to Questdb for greater than 5m, I get a successful response in the console, with no records returned.
If I run the same query as an alert condition in Grafana when there is data, the alert is healthy and does not fire. When the data is stopped, after 5 minutes the alert changes to an error:
[sse.readDataError] [voltage] got error: no float64 value column found in frame voltage
([voltage] is the name of the query)
I have tried many variations, including changing the query to ‘Time series’, (with and without the voltage column), with different errors and alerts not working along the way. For example:
SELECT timestamp FROM "tank1" WHERE $__timeFilter(timestamp) SAMPLE BY $__sampleByInterval ALIGN TO CALENDAR ORDER BY timestamp DESC
using a time range of ‘Now -5m’ to restrict the data. This query produces the error:
[sse.readDataError] [voltage] got error: input data must be a wide series but got type not (input refid)
I want to alert on both the voltage level (<11.5V) and ‘No Data’, but it’s not a problem if I can’t do both in one alert.
Can anyone assist please?