@@ -28,10 +28,9 @@ import (
28
28
)
29
29
30
30
var (
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"
35
34
)
36
35
37
36
// ScrapResult is container structure for error handling
@@ -463,13 +462,14 @@ func (e *Exporter) reloadMetrics() {
463
462
// If custom metrics, load it
464
463
if strings .Compare (e .config .CustomMetrics , "" ) != 0 {
465
464
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 {
467
467
level .Error (e .logger ).Log (err )
468
468
panic (errors .New ("Error while loading " + _customMetrics ))
469
469
} else {
470
470
level .Info (e .logger ).Log ("msg" , "Successfully loaded custom metrics from " + _customMetrics )
471
471
}
472
- e .metricsToScrape .Metric = append (e .metricsToScrape .Metric , additionalMetrics .Metric ... )
472
+ e .metricsToScrape .Metric = append (e .metricsToScrape .Metric , metrics .Metric ... )
473
473
}
474
474
} else {
475
475
level .Debug (e .logger ).Log ("msg" , "No custom metrics defined." )
0 commit comments