From 29321400ead4377ca1583cba6d8fc9ff565c1e6a Mon Sep 17 00:00:00 2001 From: Ezri Zhu Date: Tue, 17 Sep 2024 21:14:37 -0400 Subject: [PATCH] export site id --- cycle.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cycle.go b/cycle.go index 3723990..1229710 100644 --- a/cycle.go +++ b/cycle.go @@ -1,6 +1,8 @@ package main import ( + "strconv" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) @@ -11,7 +13,7 @@ var ( routesGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "current_announcements", Help: "current announcements", - }, []string{"prefix", "site"}) + }, []string{"prefix", "site", "id"}) ) func (p *Prefix) update(site *ConfigSite) { @@ -19,6 +21,7 @@ func (p *Prefix) update(site *ConfigSite) { routesGauge.WithLabelValues( p.prefix, p.lastAdvSite.Name, + strconv.Itoa(p.lastAdvSite.Id), ).Set(0) p.bgpWithdraw() } @@ -27,6 +30,7 @@ func (p *Prefix) update(site *ConfigSite) { routesGauge.WithLabelValues( p.prefix, p.lastAdvSite.Name, + strconv.Itoa(p.lastAdvSite.Id), ).Set(1) return