Skip to content

Conversation

@xconverge
Copy link
Contributor

Summary

Fixes #379

I had tried this and it wasn't working:

alerting:
  slack:
    webhook-url: xyz
    default-alert:
      description: "Health Check"
      send-on-resolved: true
      failure-threshold: 2
      success-threshold: 2
      minimum-reminder-interval: 48h

It does work if you put it with each endpoint specifically though

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

@TwiN TwiN changed the title Adjust minimum reminder config parsing fix(alerting): Adjust minimum reminder config parsing Aug 26, 2025
@TwiN TwiN merged commit d41cfc0 into TwiN:master Aug 26, 2025
3 checks passed
@day1118
Copy link

day1118 commented Aug 26, 2025

Hi @xconverge
I noticed that if I had multiple alerts listed for a endpoint, only the first alerting service would get the repeated notification. Do you see the same behaviour? I wonder if this is another config parsing issue.

alerting:
  discord:
    webhook-url: <xxx>
    default-alert:
      enabled: true
      send-on-resolved: true
      minimum-reminder-interval: 5m

  ntfy:
    topic: Gatus
    url: <xxx>
    default-alert:
      failure-threshold: 3
      send-on-resolved: true
      minimum-reminder-interval: 5m

endpoints:
  - name: "Google DNS 1"
    group: "Public"
    url: "icmp://8.8.8.8"
    conditions:
      - "[RESPONSE_TIME] < 100"
    alerts:
      - type: discord
      - type: ntfy

  - name: "Google DNS 2"
    group: "Public"
    url: "icmp://8.8.4.4"
    conditions:
      - "[RESPONSE_TIME] < 100"
    alerts:
      - type: ntfy
      - type: discord

In this example, I see that repeats are only sent to discord for Google DNS 1 and ntfy for Google DNS 2. I expect that both get the repeated notifications.

@xconverge
Copy link
Contributor Author

Hi @xconverge I noticed that if I had multiple alerts listed for a endpoint, only the first alerting service would get the repeated notification. Do you see the same behaviour? I wonder if this is another config parsing issue.

alerting:
  discord:
    webhook-url: <xxx>
    default-alert:
      enabled: true
      send-on-resolved: true
      minimum-reminder-interval: 5m

  ntfy:
    topic: Gatus
    url: <xxx>
    default-alert:
      failure-threshold: 3
      send-on-resolved: true
      minimum-reminder-interval: 5m

endpoints:
  - name: "Google DNS 1"
    group: "Public"
    url: "icmp://8.8.8.8"
    conditions:
      - "[RESPONSE_TIME] < 100"
    alerts:
      - type: discord
      - type: ntfy

  - name: "Google DNS 2"
    group: "Public"
    url: "icmp://8.8.4.4"
    conditions:
      - "[RESPONSE_TIME] < 100"
    alerts:
      - type: ntfy
      - type: discord

In this example, I see that repeats are only sent to discord for Google DNS 1 and ntfy for Google DNS 2. I expect that both get the repeated notifications.

I only use 1 alert so I won't see the same thing, sorry. If I find time I will look into it but no promises

@xconverge
Copy link
Contributor Author

@day1118 I think I see the issue but will need to check later

https://github.com/TwiN/gatus/pull/1138/files#diff-24a879c184b01d0c5cabbb5d90d3e6c8ed459a1e50a3d7a4596b130c87e59217R38

For this logic

// Determine if a reminder should be sent
sendReminder := endpointAlert.Triggered && endpointAlert.MinimumReminderInterval > 0 && time.Since(ep.LastReminderSent) >= endpointAlert.MinimumReminderInterval

since ep is a pointer, after the first reminder alert is sent to the first alert provider, ep.LastReminderSent is updated, so the 2nd alert provider fails this check

I think we can just move and store the value of ep.LastReminderSent to the top of the function before we process alerts, instead of dynamically within the loop

@TwiN
Copy link
Owner

TwiN commented Aug 26, 2025

@xconverge @day1118 I'll take care of it.

Sorry for the oversight, I usually test core features like this very thoroughly before releasing them, but between all the new features I've been working on, I've neglected this. What certainly doesn't help is that the watchdog package is the package with the worst testing coverage, mostly due to the complexity of testing what pretty much ties everything Gatus does together.

TwiN added a commit that referenced this pull request Aug 26, 2025
@TwiN
Copy link
Owner

TwiN commented Aug 26, 2025

I wasn't able to create a unit test to accurately replicate the issue, but it should be resolved by 10cabb9

I would strongly appreciate if either of you (@day1118 & @xconverge) could confirm the issue no longer happens.

alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Sep 18, 2025
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/twin/gatus](https://github.com/TwiN/gatus) | minor | `v5.23.2` -> `v5.24.0` |

---

### Release Notes

<details>
<summary>TwiN/gatus (ghcr.io/twin/gatus)</summary>

### [`v5.24.0`](https://github.com/TwiN/gatus/releases/tag/v5.24.0)

[Compare Source](TwiN/gatus@v5.23.2...v5.24.0)

Another big update worthy of highlights. There are 3 big changes coming to Gatus with this release.

- **Suites** (ALPHA): To keep it short, this allows you to monitor a list of endpoints in order, but those endpoints have a shared context that allows you to store values and compare or use them in other endpoints. For more information, see <TwiN/gatus#1241>
- **New alerting providers**: 14 new alerting providers have been added, but there's a catch. I don't have time to test this many providers, so I'm trying something new, namely, letting users who want to use those alerting providers test them for me. For more information, see <TwiN/gatus#1223>
- **RDAP support for `[DOMAIN_EXPIRATION]` placeholder**: Some TLDs have started dropping support for WHOIS, as such, support for RDAP has been added. WHOIS will still be used as a fallback if RDAP fails to resolve the domain expiration of a domain.

I am very excited to finally have made some progress on suites. It's missing some features, and it required a lot of redesigning, so I expect some complaints, but with suites, the possibilities feel endless. You can monitor entire workflows, simulate complex user behavior, not just READ-type of behavior, but WRITE as well, as you can configure an endpoint to run even if the workflow fails to clean up whatever resource you created, and so much more. Suites have some serious potential.

#### What's Changed

- feat(suite): Implement Suites by [@&#8203;TwiN](https://github.com/TwiN) in [#&#8203;1239](TwiN/gatus#1239)
- feat(alerting): Add new providers for Datadog, IFTTT, Line, NewRelic, Plivo, RocketChat, SendGrid, Signal, SIGNL4, Splunk, Squadcast, Vonage, Webex and Zapier by [@&#8203;TwiN](https://github.com/TwiN) in [#&#8203;1224](TwiN/gatus#1224)
- feat(client): Add RDAP support for domain expiration by [@&#8203;ju-ef](https://github.com/ju-ef) in [#&#8203;1181](TwiN/gatus#1181)
- feat(client): starttls support for dns resolver by [@&#8203;eleith](https://github.com/eleith) in [#&#8203;1253](TwiN/gatus#1253)
- fix(alerting): Adjust minimum reminder config parsing by [@&#8203;xconverge](https://github.com/xconverge) in [#&#8203;1226](TwiN/gatus#1226)
- fix(client): add forward ip support in PTR query-name by [@&#8203;denis-ev](https://github.com/denis-ev) in [#&#8203;1261](TwiN/gatus#1261)
- docs: Fix typo in Zulip configuration section by [@&#8203;XavierDupuis](https://github.com/XavierDupuis) in [#&#8203;1220](TwiN/gatus#1220)
- docs: information on escaping endpoint url in config by [@&#8203;muzy](https://github.com/muzy) in [#&#8203;1242](TwiN/gatus#1242)

#### New Contributors

- [@&#8203;XavierDupuis](https://github.com/XavierDupuis) made their first contribution in [#&#8203;1220](TwiN/gatus#1220)
- [@&#8203;eleith](https://github.com/eleith) made their first contribution in [#&#8203;1253](TwiN/gatus#1253)
- [@&#8203;ju-ef](https://github.com/ju-ef) made their first contribution in [#&#8203;1181](TwiN/gatus#1181)
- [@&#8203;denis-ev](https://github.com/denis-ev) made their first contribution in [#&#8203;1261](TwiN/gatus#1261)
- [@&#8203;muzy](https://github.com/muzy) made their first contribution in [#&#8203;1242](TwiN/gatus#1242)

**Full Changelog**: <TwiN/gatus@v5.23.2...v5.24.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTYuNSIsInVwZGF0ZWRJblZlciI6IjQxLjExNi41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbWFnZSJdfQ==-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/1491
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeating notifications

3 participants