diff --git a/modules/caddyhttp/reverseproxy/healthchecks.go b/modules/caddyhttp/reverseproxy/healthchecks.go index a55fd5b70..aabc23769 100644 --- a/modules/caddyhttp/reverseproxy/healthchecks.go +++ b/modules/caddyhttp/reverseproxy/healthchecks.go @@ -481,7 +481,7 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, networ if upstream.activeHealthFails() >= h.HealthChecks.Active.Fails { // dispatch an event that the host newly became unhealthy if upstream.setHealthy(false) { - h.events.Emit(h.ctx, "unhealthy", map[string]any{"host": hostAddr}) + h.events.Emit(h.ctx, "unhealthy", map[string]any{"host": hostAddr, "addr": networkAddr}) upstream.resetHealth() } } @@ -504,7 +504,7 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, networ if c := h.HealthChecks.Active.logger.Check(zapcore.InfoLevel, "host is up"); c != nil { c.Write(zap.String("host", hostAddr)) } - h.events.Emit(h.ctx, "healthy", map[string]any{"host": hostAddr}) + h.events.Emit(h.ctx, "healthy", map[string]any{"host": hostAddr, "addr": networkAddr}) upstream.resetHealth() } }