Skip to content

Commit

Permalink
fix: collect leafnode info metric
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolce authored and piotrpio committed Oct 10, 2024
1 parent e0fa271 commit fc9d408
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions collector/leafz.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func (lm *leafMetrics) Describe(ch chan<- *prometheus.Desc) {
// Collect collects all the metrics about the a leafnode connection.
func (lm *leafMetrics) Collect(server *CollectedServer, lf *Leaf, ch chan<- prometheus.Metric) {

ch <- prometheus.MustNewConstMetric(lm.info, prometheus.GaugeValue, float64(1.0),
server.ID, lf.Account, lf.IP, fmt.Sprint(lf.Port), lf.Name)

rtt, _ := time.ParseDuration(lf.RTT)
ch <- prometheus.MustNewConstMetric(lm.connRtt, prometheus.GaugeValue, rtt.Seconds(),
server.ID, lf.Account, lf.IP, fmt.Sprint(lf.Port), lf.Name)
Expand Down

0 comments on commit fc9d408

Please sign in to comment.