How to create Grafana alerts with InfluxDB and the Flux query language

There have not been a lot of easy-to-follow examples using Flux for creating Grafana Alerts, so with the kind permission of the Grafana Labs team, I put together 5 examples that use Flux queries which can be used with Grafana Alerting. Hope this helps others who might be just getting started with Flux and Grafana Alerting.

Please reply here if there is any feedback or questions.

2 Likes

Awesome! One thing I can’t get to work is alerts for future values, how would you do that? I have a set of forecasted values and would like to alert based on values exceeding the threshold in there. Alerts don’t seem to allow values into the future.

@francisbehnen

I agree that it seems the Alerts time selector window does not allow future times.

I also could not write the time directly into the |> range(start:

Wow! Thank you for sharing!

So it’s not possible at all? That’s a big bummer