Skip to content

Commit

Permalink
Log SQL error message (#344)
Browse files Browse the repository at this point in the history
Co-authored-by: Oskars Pakers <oskars.pakers@zzdats.lv>
  • Loading branch information
OskarsPakers and Oskars Pakers authored Sep 18, 2023
1 parent 145b4ee commit fffdade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {

scrapeStart := time.Now()
if err = e.ScrapeMetric(e.db, ch, metric); err != nil {
level.Error(e.logger).Log("Error scraping for", metric.Context, "_", metric.MetricsDesc, time.Since(scrapeStart), ":", err)
level.Error(e.logger).Log("Error scraping for", metric.Context, "_", metric.MetricsDesc, time.Since(scrapeStart), ":", err.Error())
e.scrapeErrors.WithLabelValues(metric.Context).Inc()
} else {
level.Debug(e.logger).Log("Successfully scraped metric: ", metric.Context, metric.MetricsDesc, time.Since(scrapeStart))
Expand Down

0 comments on commit fffdade

Please sign in to comment.