Add a warning message if metric not found

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
pull/3176/head
Xiaodong Ye 4 days ago
parent 087adf328c
commit 2f4dbae09c

@ -230,6 +230,11 @@ func (c *rdmaCollector) Update(ch chan<- prometheus.Metric) error {
if !c.metricsPattern.MatchString(name) {
return
}
entry := c.entry(name)
if entry == nil {
c.logger.Warn("rdma metric not found", "name", name)
return
}
ch <- prometheus.MustNewConstMetric(c.entry(name), prometheus.GaugeValue,
value, labelValues...)
}

Loading…
Cancel
Save