Skip to content

Commit

Permalink
Add a warning message if metric not found
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaodong Ye <[email protected]>
  • Loading branch information
yeahdongcn committed Nov 20, 2024
1 parent 087adf3 commit 2f4dbae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions collector/rdma_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down

0 comments on commit 2f4dbae

Please sign in to comment.