Listen for heartbeatList in Uptime Kuma adapter to catch monitors with no status-change history (#37)
importantHeartbeatList only contains entries for status transitions, so a monitor that's been continuously up since creation never populates it, showing as "unknown" in ArchNest despite being healthy in Uptime Kuma. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d50ec0076e
commit
b4943b1155
1 changed files with 8 additions and 0 deletions
|
|
@ -90,6 +90,14 @@ export const uptimeKuma: IntegrationAdapter = {
|
|||
const latest = beats[beats.length - 1]
|
||||
if (latest) lastHeartbeat.set(monitorId, latest)
|
||||
})
|
||||
// importantHeartbeatList only contains status-change events, so a monitor
|
||||
// that's been continuously up since it was added has no entries there.
|
||||
// heartbeatList carries the regular (non-"important") beat history and is
|
||||
// sent for every monitor, so it's needed to populate those cases too.
|
||||
s.on('heartbeatList', (monitorId: number, beats: Heartbeat[]) => {
|
||||
const latest = beats[beats.length - 1]
|
||||
if (latest) lastHeartbeat.set(monitorId, latest)
|
||||
})
|
||||
s.on('heartbeat', (beat: Heartbeat & { monitorID: number }) => {
|
||||
lastHeartbeat.set(beat.monitorID, beat)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue