Skip to content

Commit 32e46d4

Browse files
author
zhongming Fan
committed
fix: scrapeErrors
1 parent 338213e commit 32e46d4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

collector/collector.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric, tick *time.Time) {
294294
}
295295
e.scrapeErrors.WithLabelValues(metric.Context).Inc()
296296
} else {
297+
// 当没有错误时设置为0
298+
e.scrapeErrors.WithLabelValues(metric.Context).Add(0)
297299
e.logger.Debug("Successfully scraped metric",
298300
"Context", metric.Context,
299301
"MetricDesc", fmt.Sprint(metric.MetricsDesc),

0 commit comments

Comments
 (0)