@@ -28,10 +28,9 @@ import (
2828)
2929
3030var (
31- additionalMetrics Metrics
32- hashMap = make (map [int ][]byte )
33- namespace = "oracledb"
34- exporterName = "exporter"
31+ hashMap = make (map [int ][]byte )
32+ namespace = "oracledb"
33+ exporterName = "exporter"
3534)
3635
3736// ScrapResult is container structure for error handling
@@ -463,13 +462,14 @@ func (e *Exporter) reloadMetrics() {
463462 // If custom metrics, load it
464463 if strings .Compare (e .config .CustomMetrics , "" ) != 0 {
465464 for _ , _customMetrics := range strings .Split (e .config .CustomMetrics , "," ) {
466- if _ , err := toml .DecodeFile (_customMetrics , & additionalMetrics ); err != nil {
465+ metrics := & Metrics {}
466+ if _ , err := toml .DecodeFile (_customMetrics , metrics ); err != nil {
467467 level .Error (e .logger ).Log (err )
468468 panic (errors .New ("Error while loading " + _customMetrics ))
469469 } else {
470470 level .Info (e .logger ).Log ("msg" , "Successfully loaded custom metrics from " + _customMetrics )
471471 }
472- e .metricsToScrape .Metric = append (e .metricsToScrape .Metric , additionalMetrics .Metric ... )
472+ e .metricsToScrape .Metric = append (e .metricsToScrape .Metric , metrics .Metric ... )
473473 }
474474 } else {
475475 level .Debug (e .logger ).Log ("msg" , "No custom metrics defined." )
0 commit comments