From e2bcc18e4da4551d964177001ff5305586ac9341 Mon Sep 17 00:00:00 2001 From: Erik Rozendaal Date: Tue, 18 Oct 2022 11:11:06 +0200 Subject: [PATCH] Update inGracePeriod metric even when data source was not modified Time still passes so VRPs may be dropped due to the expiration of the grace period. --- cmd/rtrmon/rtrmon.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/rtrmon/rtrmon.go b/cmd/rtrmon/rtrmon.go index eee3692..5e29f97 100644 --- a/cmd/rtrmon/rtrmon.go +++ b/cmd/rtrmon/rtrmon.go @@ -351,9 +351,10 @@ func (c *Client) Start(id int, ch chan int) { } updatedVrpMap, inGracePeriod = BuildNewVrpMap(log.WithField("client", c.id), c.vrps, decoded.Data, tCurrentUpdate) - VRPInGracePeriod.With(prometheus.Labels{"url": c.Path}).Set(float64(inGracePeriod)) } + VRPInGracePeriod.With(prometheus.Labels{"url": c.Path}).Set(float64(inGracePeriod)) + c.compLock.Lock() c.vrps = updatedVrpMap c.lastUpdate = tCurrentUpdate