Suppress superseded alerts in the /alerts/active endpoint
All checks were successful
ci/woodpecker/manual/build-image Pipeline was successful

This commit is contained in:
2026-06-17 06:48:14 -05:00
parent 2a33fe01cf
commit 5a1134b955
4 changed files with 102 additions and 3 deletions

View File

@@ -194,7 +194,8 @@ GET /conditions/current?format=json&precision=0
GET /alerts/active
```
Returns the latest stored alert run filtered to alerts active at request time.
Returns the latest stored alert run filtered to alerts active at request time,
omitting older alerts superseded by newer alert references in the same run.
Query parameters: `format`, `units`.
@@ -216,6 +217,9 @@ at or before request time, and the alert end boundary is absent or after request
time. The end boundary prefers `ends`; if `ends` is absent, `expires` is used as
a fallback for older rows or providers that do not supply an alert-period end.
`onset` is presented when available but is not used as the active boundary.
After active-time filtering, alerts referenced by another alert in the same run
are omitted as superseded. References from update and cancel messages are both
honored, even when the referencing alert is not itself returned.
Alert fields include `id`, `event`, `headline`, `severity`, `urgency`,
`certainty`, `status`, `messageType`, `category`, `response`, `description`,