@@ -290,15 +290,15 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric, tick *time.Time) {
290
290
e .logger .Error ("Error scraping metric" ,
291
291
"Context" , metric .Context ,
292
292
"MetricsDesc" , fmt .Sprint (metric .MetricsDesc ),
293
- "time " , time .Since (scrapeStart ),
293
+ "duration " , time .Since (scrapeStart ),
294
294
"error" , scrapeError )
295
295
}
296
296
e .scrapeErrors .WithLabelValues (metric .Context ).Inc ()
297
297
} else {
298
298
e .logger .Debug ("Successfully scraped metric" ,
299
299
"Context" , metric .Context ,
300
300
"MetricDesc" , fmt .Sprint (metric .MetricsDesc ),
301
- "time " , time .Since (scrapeStart ))
301
+ "duration " , time .Since (scrapeStart ))
302
302
}
303
303
}()
304
304
}
@@ -500,11 +500,9 @@ func (e *Exporter) scrapeGenericValues(db *sql.DB, ch chan<- prometheus.Metric,
500
500
}
501
501
// Construct Prometheus values to sent back
502
502
for metric , metricHelp := range metricsDesc {
503
- value , err := strconv .ParseFloat (strings .TrimSpace (row [metric ]), 64 )
504
- // If not a float, skip current metric
505
- if err != nil {
506
- e .logger .Error ("Unable to convert current value to float (metric=" + metric +
507
- ",metricHelp=" + metricHelp + ",value=<" + row [metric ] + ">)" )
503
+ value , ok := e .parseFloat (metric , metricHelp , row )
504
+ if ! ok {
505
+ // Skip invalid metric values
508
506
continue
509
507
}
510
508
e .logger .Debug ("Query result" ,
0 commit comments