1
0
mirror of https://github.com/bgp/stayrtr.git synced 2024-05-06 15:54:54 +00:00

[stayrtr] add a metric for current serial number

This commit is contained in:
netixx
2024-02-22 17:53:35 +01:00
parent 7bec069a27
commit bbf0f39107

View File

@ -143,6 +143,12 @@ var (
},
[]string{"type"},
)
CurrentSerial = prometheus.NewGauge(
prometheus.GaugeOpts{
Name: "rtr_serial",
Help: "Current serial.",
},
)
protoverToLib = map[int]uint8{
0: rtr.PROTOCOL_VERSION_0,
@ -159,6 +165,7 @@ func initMetrics() {
prometheus.MustRegister(RefreshStatusCode)
prometheus.MustRegister(ClientsMetric)
prometheus.MustRegister(PDUsRecv)
prometheus.MustRegister(CurrentSerial)
}
func metricHTTP() {
@ -453,6 +460,7 @@ func (s *state) applyUpdateFromNewState(vrps []rtr.VRP, brks []rtr.BgpsecKey, va
log.Debugf("Sending notifications to clients")
s.server.NotifyClientsLatest()
}
CurrentSerial.Set(float64(serial))
s.lockJson.Lock()
s.exported = prefixfile.RPKIList{