Skip to content

Commit 6c0b7c3

Browse files
committed
fix(healthcheck): publish status every check for latency telemetry
1 parent 3cce541 commit 6c0b7c3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

healthcheck/healthcheck.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,13 @@ func (m *Monitor) monitorTarget(target *Target) {
350350
// Reset timer for next check with current interval
351351
target.timer.Reset(interval)
352352

353-
// Notify callback if status changed
354-
if oldStatus != target.Status && m.callback != nil {
355-
logger.Info("Target %d status changed: %s -> %s",
356-
target.Config.ID, oldStatus.String(), target.Status.String())
353+
// Notify callback on every check so downstream systems receive fresh
354+
// latency telemetry even when health status is unchanged.
355+
if m.callback != nil {
356+
if oldStatus != target.Status {
357+
logger.Info("Target %d status changed: %s -> %s",
358+
target.Config.ID, oldStatus.String(), target.Status.String())
359+
}
357360
go m.callback(m.GetTargets())
358361
}
359362
}

0 commit comments

Comments
 (0)