From b71c0f7a9d6855a94050e2b0508250afd67ad6ab Mon Sep 17 00:00:00 2001 From: Ezri Zhu Date: Thu, 17 Oct 2024 09:40:33 -0400 Subject: [PATCH] reset gauge --- lg.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lg.go b/lg.go index 05d5545..4a77bb6 100644 --- a/lg.go +++ b/lg.go @@ -44,8 +44,6 @@ var ( func (p *Prefix) checkLGState() { log.Trace().Str("Prefix", p.prefix).Msg("checking prefix state") - upstreamsGauge.Reset() - upstreams2Gauge.Reset() url := ripestatBase + "/data/looking-glass/data.json?resource=" + p.prefix + "&sourceapp=" + appId resp, err := http.Get(url) if err != nil { @@ -151,6 +149,7 @@ func (p *Prefix) checkLGState() { communities = append(communities, peer.Community) } + upstreamsGauge.Reset() upstreamsGauge.WithLabelValues( p.prefix, p.pop, @@ -159,6 +158,7 @@ func (p *Prefix) checkLGState() { origin, ).Set(float64(len(upstreams))) + upstreams2Gauge.Reset() upstreams2Gauge.WithLabelValues( p.prefix, p.pop, @@ -167,6 +167,7 @@ func (p *Prefix) checkLGState() { origin, ).Set(float64(len(upstreams2))) + bgpCommunitiesGauge.Reset() communities = slices.Compact(communities) for _, e := range communities { bgpCommunitiesGauge.WithLabelValues(