TwiN / gatus

⛑ Automated developer-oriented status page

Home Page:https://gatus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alerts triggered status is not persistent

macmoritz opened this issue · comments

Describe the bug

The triggered status of a monitor is only momentary. After a restart of gatus the information is gone.

Such restarts are daily business in cloud environments.

What do you see?

No response

What do you expect to see?

Gatus should only send one alert for a failing monitor.

List the steps that must be taken to reproduce this issue

  1. gatus starts
  2. after some time a monitored service fails
  3. gatus sends an alert after checking if alert was sended before
  4. gatus will not send more notifications for this monitor, which is correct (log: [watchdog][handleAlertsToTrigger] Sending matrix alert because alert for endpoint=my-endpoint='' has been TRIGGERED)
  5. gatus restarts
  6. gatus will send an alert for the monitor again

Version

No response

Additional information

Fix could be to use the events from the database for checking if an alert was already sended.

commented

Yes, you're right. It's also something I've been wanting to take care of for a while.

I would also add something like UUID of the sent alert and keep the same UUID when the alert gets resolved or sending is repeated by any reason. That UUID should be available in the alert templating.

commented

PR is up @ #764 but further testing is necessary