Is there a way to write a little more advance alerting task using Flux in Influx 2, something similar to Kapacitor? As far as I understand, we can only set a constant threshold using the UI.
Edit: I have a time series, and I want to know if series A exceeds B? I don’t have a constant threshold. How can I handle this?
Your example works fine generally. I’ve some questions if you don’t mind.
Is there a difference between monitor["check"]() and monitor.check()? Both seems working?
In your example, we didn’t use |> last() or |> mean(), so there may be more than one observation.
How is the crit function works in that case? I assume it’ll return the result for the last row?
Edit: I read the blog post. I wish I had found the blog post this morning. It’s would be a good start.
Hello @Mert,
No that’s just different syntax for the same thing.
So the predicate functions messagfn() and crit(), ok(), info(), etc depending on what the user inclues are passed into the monitor.check() function. The monitor.check function takes the input and assigns a level and message for each row using the predicate functions.
I’m glad the blog was useful. Please let me know if there are points of confusion or anything I need to append/explain further.