Compare commits

...

2 commits

Author SHA1 Message Date
90925b6f84
prepare release v0.4.0 2024-04-15 23:12:27 +02:00
feb2aa23ab
Improve logging for up/down changes
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-04-15 23:11:45 +02:00
2 changed files with 18 additions and 4 deletions

View file

@ -1,3 +1,7 @@
# 0.4.0 / 2024-04-15
* Improve logging for up/down changes
# 0.3.0 / 2024-04-15
* Add support for hostnames in addresses

View file

@ -76,14 +76,24 @@ func (m Monitor) updateRoutingTargets(checker healthcheck.Checker) (err error) {
}
if err := checker.Check(m.svc.HealthCheck.Settings, t); err != nil {
logger.WithError(err).Debug("detected target down")
changed = changed || m.ipt.UnregisterServiceTarget(m.svc.Name, tgt)
if m.ipt.UnregisterServiceTarget(m.svc.Name, tgt) {
logger.WithError(err).Warn("detected target down")
changed = true
} else {
logger.WithError(err).Debug("detected target down")
}
down = append(down, t.String())
return
}
logger.Debug("target up")
changed = changed || m.ipt.RegisterServiceTarget(m.svc.Name, tgt)
if m.ipt.RegisterServiceTarget(m.svc.Name, tgt) {
logger.Info("target up")
changed = true
} else {
logger.Debug("target up")
}
up = append(up, t.String())
}()
}