Good day everyone!
I’m experiencing a weird issue. My setup is very simple: a raspi3 with influxDB + a temperature probe… and grafana on a another server. I’m able to import my influxDB souce, run queries from grafana 9.x and 10.x (I tested both) and I always get the result properly. I’m able to build a dashboard and it updates very well.
Yet, when setting up a simple alarm either in 9.x or 10.x, I get no alarm when the conditions were true OR I get “alertname = DatasourceNoData”… But there is data!!!
If I disable nodata alarm seting up to “ok”, I get nothing at all… and the alarm status indicates no data… ?
pi = config with probe + data dropped locally on pi in influxDB
grafana = different server… connection to influxdb datasource = success
grafana dashboard = perfect. I see all temperature changes… therefore, I know the data is there.
grafana alarms = not working besides telling the “nodata” alarm.
My query results within grafana = always provide numbers yet, when letting the alarm do the job, I get NaN + no data in the alert status.
alarm setup = simple query + expression B = reduce last strict , expression C = math $B > 21 (or any other degrees… nothing works) example: also tried $B < 21 || $B > 25 …
NB: I read the documentation and followed the grafana tutorial to ensure I wasn’t doing someting stupid (I’m new to grafana). Looks like it should work.
Should I send my probe data to a seperate influxdb vs directly on the pi?
I would really appreciate some help + guidance…
Not sure if it is related but, are you using legacy alerts or new Grafana unified alerting.
for me it happened something unusual after I upgrade Grafana 8.5 using legacy alerting and maintaining legacy alerting on Grafana 9.5 the alert was still there but if I made any changes to the query or tried to do any changes on the alert (legacy) it did not change, also new alerts were not showing any alert even if the query was returning data.
so, if you have Grafana 9.x or 10 and happen to be using legacy alerts you may consider migrating to unified alerting.
I’m not sure what legacy alerts are vs unified alerts… so I looked at a video
From the video… this seems to be the new unified alert which was launched on version 8.
Perhaps this will help:
to create an alarm, I click on Alerting → Alert rules → +create alert rule…
then I name the alert, select Grafana managed alert… then I choose my data source, build my query, test/preview the query (and I see it fires at my alarms parameters)… below I configure the delays between queries and before firing etc…
Further research into various forums revealed the version of influxdb I used 1.8.x has a bug where grafana version 9+ doesn’t see the data and returns no data alerts. Long story short, I downgraded to 8.27 and the nodata alerts stopped and alerts started to work again.
Unless one of you knows an acceptable fix, I will schedule time to upgrade to influxdb 2+ and learn the basics for its integration into python scripts. Until then, the problem is resolved temporarily with this downgrade.