mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-03-05 21:00:12 -08:00
Add a warning message if metric not found
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
parent
5346a18a04
commit
699af30017
|
@ -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…
Reference in a new issue