Skip to content

Commit

Permalink
Fix uptime metric (#463)
Browse files Browse the repository at this point in the history
Signed-off-by: netixx <francois.espinet@ovhcloud.com>
  • Loading branch information
netixx authored Apr 18, 2024
1 parent a330f47 commit 2c3540b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/bgp/adapter/prom/bgp_prom_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func collectForPeer(ch chan<- prometheus.Metric, peer *metrics.BGPPeerMetrics) {

var uptime float64
if peer.State == metrics.StateEstablished {
uptime = float64(time.Since(peer.Since) * time.Second)
uptime = time.Since(peer.Since).Seconds()
}
ch <- prometheus.MustNewConstMetric(uptimeDesc, prometheus.GaugeValue, uptime, l...)
ch <- prometheus.MustNewConstMetric(stateDesc, prometheus.GaugeValue, float64(peer.State), l...)
Expand Down

0 comments on commit 2c3540b

Please sign in to comment.