Compare commits
2 commits
d51b6dc8e8
...
90925b6f84
Author | SHA1 | Date | |
---|---|---|---|
90925b6f84 | |||
feb2aa23ab |
2 changed files with 18 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue