aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-07-02 20:51:02 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-07-02 20:51:02 +0800
commit1990c9e6216fd6b25fdf6447844f36405b75c18e (patch)
treea06426641caf1e61ea788a5280d7047981e6ac67 /cmd/geth
parent223d943481d16c4874165288cfb68e7350a9104e (diff)
downloadgo-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.tar
go-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.tar.gz
go-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.tar.bz2
go-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.tar.lz
go-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.tar.xz
go-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.tar.zst
go-tangerine-1990c9e6216fd6b25fdf6447844f36405b75c18e.zip
cmd/geth: export metrics to InfluxDB (#16979)
* cmd/geth: add flags for metrics export * cmd/geth: update usage fields for metrics flags * metrics/influxdb: update reporter logger to adhere to geth logging convention
Diffstat (limited to 'cmd/geth')
-rw-r--r--cmd/geth/main.go13
-rw-r--r--cmd/geth/usage.go13
2 files changed, 25 insertions, 1 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index edf2a557a..f4a0ac5df 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -144,6 +144,15 @@ var (
utils.WhisperMaxMessageSizeFlag,
utils.WhisperMinPOWFlag,
}
+
+ metricsFlags = []cli.Flag{
+ utils.MetricsEnableInfluxDBFlag,
+ utils.MetricsInfluxDBEndpointFlag,
+ utils.MetricsInfluxDBDatabaseFlag,
+ utils.MetricsInfluxDBUsernameFlag,
+ utils.MetricsInfluxDBPasswordFlag,
+ utils.MetricsInfluxDBHostTagFlag,
+ }
)
func init() {
@@ -186,6 +195,7 @@ func init() {
app.Flags = append(app.Flags, consoleFlags...)
app.Flags = append(app.Flags, debug.Flags...)
app.Flags = append(app.Flags, whisperFlags...)
+ app.Flags = append(app.Flags, metricsFlags...)
app.Before = func(ctx *cli.Context) error {
runtime.GOMAXPROCS(runtime.NumCPU())
@@ -208,6 +218,9 @@ func init() {
log.Debug("Sanitizing Go's GC trigger", "percent", int(gogc))
godebug.SetGCPercent(int(gogc))
+ // Start metrics export if enabled
+ utils.SetupMetrics(ctx)
+
// Start system runtime metrics collection
go metrics.CollectProcessMetrics(3 * time.Second)
diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go
index d934c6b02..06db64664 100644
--- a/cmd/geth/usage.go
+++ b/cmd/geth/usage.go
@@ -206,12 +206,23 @@ var AppHelpFlagGroups = []flagGroup{
{
Name: "LOGGING AND DEBUGGING",
Flags: append([]cli.Flag{
- utils.MetricsEnabledFlag,
utils.FakePoWFlag,
utils.NoCompactionFlag,
}, debug.Flags...),
},
{
+ Name: "METRICS AND STATS",
+ Flags: []cli.Flag{
+ utils.MetricsEnabledFlag,
+ utils.MetricsEnableInfluxDBFlag,
+ utils.MetricsInfluxDBEndpointFlag,
+ utils.MetricsInfluxDBDatabaseFlag,
+ utils.MetricsInfluxDBUsernameFlag,
+ utils.MetricsInfluxDBPasswordFlag,
+ utils.MetricsInfluxDBHostTagFlag,
+ },
+ },
+ {
Name: "WHISPER (EXPERIMENTAL)",
Flags: whisperFlags,
},