Compare commits

..

No commits in common. "90925b6f84923d0eb98c6ead98eeab2c1c737cc7" and "d51b6dc8e8df466101ba43d998ede368cf3c2606" have entirely different histories.

2 changed files with 4 additions and 18 deletions

View file

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

View file

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