Add a warning message if metric not found
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
parent
087adf328c
commit
2f4dbae09c
|
@ -230,6 +230,11 @@ func (c *rdmaCollector) Update(ch chan<- prometheus.Metric) error {
|
||||||
if !c.metricsPattern.MatchString(name) {
|
if !c.metricsPattern.MatchString(name) {
|
||||||
return
|
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,
|
ch <- prometheus.MustNewConstMetric(c.entry(name), prometheus.GaugeValue,
|
||||||
value, labelValues...)
|
value, labelValues...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue