Skip to content

Commit 90de8d2

Browse files
authored
Revert "metrics: add support for enabling metrics from env vars (ethereum#28118)"
This reverts commit e284083.
1 parent fc4156d commit 90de8d2

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

metrics/metrics.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import (
99
"os"
1010
"runtime/metrics"
1111
"runtime/pprof"
12-
"strconv"
1312
"strings"
14-
"syscall"
1513
"time"
1614

1715
"github.com/ethereum/go-ethereum/log"
@@ -32,35 +30,13 @@ var EnabledExpensive = false
3230
// enablerFlags is the CLI flag names to use to enable metrics collections.
3331
var enablerFlags = []string{"metrics"}
3432

35-
// enablerEnvVars is the env var names to use to enable metrics collections.
36-
var enablerEnvVars = []string{"GETH_METRICS"}
37-
3833
// expensiveEnablerFlags is the CLI flag names to use to enable metrics collections.
3934
var expensiveEnablerFlags = []string{"metrics.expensive"}
4035

41-
// expensiveEnablerEnvVars is the env var names to use to enable metrics collections.
42-
var expensiveEnablerEnvVars = []string{"GETH_METRICS_EXPENSIVE"}
43-
4436
// Init enables or disables the metrics system. Since we need this to run before
4537
// any other code gets to create meters and timers, we'll actually do an ugly hack
4638
// and peek into the command line args for the metrics flag.
4739
func init() {
48-
for _, enabler := range enablerEnvVars {
49-
if val, found := syscall.Getenv(enabler); found && !Enabled {
50-
if enable, _ := strconv.ParseBool(val); enable { // ignore error, flag parser will choke on it later
51-
log.Info("Enabling metrics collection")
52-
Enabled = true
53-
}
54-
}
55-
}
56-
for _, enabler := range expensiveEnablerEnvVars {
57-
if val, found := syscall.Getenv(enabler); found && !EnabledExpensive {
58-
if enable, _ := strconv.ParseBool(val); enable { // ignore error, flag parser will choke on it later
59-
log.Info("Enabling expensive metrics collection")
60-
EnabledExpensive = true
61-
}
62-
}
63-
}
6440
for _, arg := range os.Args {
6541
flag := strings.TrimLeft(arg, "-")
6642

0 commit comments

Comments
 (0)