From 1990c9e6216fd6b25fdf6447844f36405b75c18e Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 2 Jul 2018 14:51:02 +0200 Subject: 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 --- cmd/geth/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmd/geth/main.go') 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) -- cgit