File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ type Metrics struct {
53
53
}
54
54
55
55
// Metrics to scrap. Use external file (default-metrics.toml and custom if provided)
56
- var metricsToScrap Metrics
56
+ var (
57
+ metricsToScrap Metrics
58
+ additionalMetrics Metrics
59
+ )
57
60
58
61
// Exporter collects Oracle DB metrics. It implements prometheus.Collector.
59
62
type Exporter struct {
@@ -327,10 +330,11 @@ func main() {
327
330
328
331
// If custom metrics, load it
329
332
if strings .Compare (* customMetrics , "" ) != 0 {
330
- if _ , err := toml .DecodeFile (* customMetrics , & metricsToScrap ); err != nil {
333
+ if _ , err := toml .DecodeFile (* customMetrics , & additionalMetrics ); err != nil {
331
334
log .Errorln (err )
332
335
panic (errors .New ("Error while loading " + * customMetrics ))
333
336
}
337
+ metricsToScrap .Metric = append (metricsToScrap .Metric , additionalMetrics .Metric ... )
334
338
}
335
339
exporter := NewExporter (dsn )
336
340
prometheus .MustRegister (exporter )
You can’t perform that action at this time.
0 commit comments