@@ -290,15 +290,15 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric, tick *time.Time) {
290290 e .logger .Error ("Error scraping metric" ,
291291 "Context" , metric .Context ,
292292 "MetricsDesc" , fmt .Sprint (metric .MetricsDesc ),
293- "time " , time .Since (scrapeStart ),
293+ "duration " , time .Since (scrapeStart ),
294294 "error" , scrapeError )
295295 }
296296 e .scrapeErrors .WithLabelValues (metric .Context ).Inc ()
297297 } else {
298298 e .logger .Debug ("Successfully scraped metric" ,
299299 "Context" , metric .Context ,
300300 "MetricDesc" , fmt .Sprint (metric .MetricsDesc ),
301- "time " , time .Since (scrapeStart ))
301+ "duration " , time .Since (scrapeStart ))
302302 }
303303 }()
304304 }
@@ -500,11 +500,9 @@ func (e *Exporter) scrapeGenericValues(db *sql.DB, ch chan<- prometheus.Metric,
500500 }
501501 // Construct Prometheus values to sent back
502502 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
508506 continue
509507 }
510508 e .logger .Debug ("Query result" ,
0 commit comments