Skip to content

Commit d9f1ec4

Browse files
committed
fix(healthcheck): publish status every check for latency telemetry
1 parent 896abb1 commit d9f1ec4

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

healthcheck/healthcheck.go

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

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

0 commit comments

Comments
 (0)