Skip to content

Commit

Permalink
Merge pull request #113 from netixx/serial-metric
Browse files Browse the repository at this point in the history
[stayrtr] add a metric for current serial number
  • Loading branch information
ties authored Feb 22, 2024
2 parents 7bec069 + bbf0f39 commit b773a90
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 b773a90

Please sign in to comment.