mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Also log environment info
This commit is contained in:
parent
a1ffc53998
commit
372f5cae7c
2 changed files with 6 additions and 2 deletions
|
|
@ -186,7 +186,7 @@ func (h *HA) realize(s *icingaredisv1.IcingaStatus, t *types.UnixMilli, shouldLo
|
|||
}
|
||||
|
||||
if shouldLog {
|
||||
h.logger.Infow("Another instance is active", "instance_id", instance.Id, "heartbeat", instance.Heartbeat, zap.Duration("heartbeat_age", time.Now().Sub(instance.Heartbeat.Time())))
|
||||
h.logger.Infow("Another instance is active", "instance_id", instance.Id, zap.String("environment", s.Environment), "heartbeat", instance.Heartbeat, zap.Duration("heartbeat_age", time.Now().Sub(instance.Heartbeat.Time())))
|
||||
}
|
||||
takeover = false
|
||||
break
|
||||
|
|
|
|||
|
|
@ -112,7 +112,11 @@ func (h Heartbeat) controller() {
|
|||
select {
|
||||
case m := <-messages:
|
||||
if !h.active {
|
||||
h.logger.Info("Received first Icinga 2 heartbeat")
|
||||
s, err := m.IcingaStatus()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
h.logger.Infow("Received first Icinga 2 heartbeat", zap.String("environment", s.Environment))
|
||||
h.active = true
|
||||
}
|
||||
h.beat <- m
|
||||
|
|
|
|||
Loading…
Reference in a new issue