Skip to content

Commit

Permalink
[stayrtr] add a metric for current serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
netixx committed Feb 22, 2024
1 parent 7bec069 commit bbf0f39
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/stayrtr/stayrtr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -159,6 +165,7 @@ func initMetrics() {
prometheus.MustRegister(RefreshStatusCode)
prometheus.MustRegister(ClientsMetric)
prometheus.MustRegister(PDUsRecv)
prometheus.MustRegister(CurrentSerial)
}

func metricHTTP() {
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit bbf0f39

Please sign in to comment.