There is a way to setup a repeat interval for the alerts?
What I mean is like, after the first alert was successfully sent it should only notify again based on this repeat interval time.
What I would like to achieve is
I have an alert to check for a condition every minute and would like to have a repeat interval configured of 2 hours.
So if device1 goes down the alert is sent after 1 minute and the second alert should be sent only after 2 hours.
Is that possible?
If you’re using the monitoring bucket or any bucket to write when you’ve sent an alert then you can query that bucket and verify whether you return any results from the past two hours and if true, don’t send.
There isn’t a way to delay the second alert with Flux.
In general for what its worth, I dont like to use the _monitoring bucket and monitior.from and monitor.check functions. I like to write alerts with this approach instead because I find it to be a little less of a black box.
Hi @Anaisdg thank your for the answer.
One question, can I use Go or Rust to write the tasks instead of influx language? I really need to invest some time to understand the language and the built-in functions and I have no time at the moment as the project needs to be delivered soon.
Working with timestamps can be tricky I didn’t check how the time is stored but I presume this is in UTC so would be much easier for me to work with a language I know well, even python would work.
I was thinking to create an api and send all the alerts to this api and handle the alerts from there to msteams and to sendgrid I believe would be easier than writing tasks in influx.
The influxdb support for teams is still very limited and the teams library is extremally limited.
I want to integrate the alerts on teams and add many functionalities to let users to interact with it.
There is one thing blocking me to start the api to intermediate the alerts, in the notification endpoints I see that there is support for HTTP and there is support for Bearer tokens but I don’t see any way to refresh the tokens, maybe I am missing something here?
I can’t implement the api with basic auth only and I can’t allocate a token that never expires this will never be approved.
There is a way I could request a new token every 12 hours or so through influxdb?