Verified Commit 5ae89f9d authored by meskio's avatar meskio 🏔️
Browse files

Add a metric with the number of bridges in the new pool

So we can set up an alert if it goes low.
parent 7a879786
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -72,7 +72,9 @@ func (d *TelegramDistributor) LoadNewBridges(name string, r io.Reader) error {
	}
	d.newHashrightLock.Unlock()

	log.Println("Got", len(resourceList), "new bridges from", name)
	numBridges := len(resourceList)
	log.Println("Got", numBridges, "new bridges from", name)
	newBridgesGauge.WithLabelValues(name).Set(float64(numBridges))

	persistence := d.NewBridgesStore[name]
	if persistence != nil {
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,13 @@ var (
	},
		[]string{"pool", "status"},
	)

	newBridgesGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name: "telegram_new_bridges",
		Help: "The total number of new bridges in the telegram distributor",
	},
		[]string{"updater"},
	)
)

type metricsData struct {