Skip to content

Commit c49aace

Browse files
author
Chris Pick
committed
Treat failure to collect metric as fatal
Exit on any failure to collect metrics. This will give `stackdriver_exporter` a chance to start over and perhaps recover from transient errors. For example: if it's Google credentials have expired and have been replaced, it can restart to try to load up new ones. Signed-off-by: Chris Pick <[email protected]>
1 parent dc04cd8 commit c49aace

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collectors/monitoring_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (c *MonitoringCollector) Collect(ch chan<- prometheus.Metric) {
187187
if err := c.reportMonitoringMetrics(ch); err != nil {
188188
errorMetric = float64(1)
189189
c.scrapeErrorsTotalMetric.Inc()
190-
log.Errorf("Error while getting Google Stackdriver Monitoring metrics: %s", err)
190+
log.Fatalf("Error while getting Google Stackdriver Monitoring metrics: %s", err)
191191
}
192192
c.scrapeErrorsTotalMetric.Collect(ch)
193193

0 commit comments

Comments
 (0)