Skip to content

Commit

Permalink
Merge pull request #210 from benv666/benv666/metrics-env-override
Browse files Browse the repository at this point in the history
Add node 'ENABLE_METRICS=true' environment override
  • Loading branch information
jclapis authored Aug 9, 2022
2 parents c4224f0 + e44ea47 commit 3803c55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rocketpool/node/metrics-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package node

import (
"fmt"
"os"
"net/http"
"strings"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down Expand Up @@ -38,7 +40,11 @@ func runMetricsServer(c *cli.Context, logger log.ColorLogger) error {

// Return if metrics are disabled
if cfg.EnableMetrics.Value == false {
return nil
if strings.ToLower(os.Getenv("ENABLE_METRICS")) == "true" {
logger.Printlnf("ENABLE_METRICS override set to true, will start Metrics exporter anyway!")
} else {
return nil
}
}

nodeAccount, err := w.GetNodeAccount()
Expand Down

0 comments on commit 3803c55

Please sign in to comment.