cmd, metrics: add support for influxdb-v2 (cherry-picking from italoacasas' changes), leave existing support for v1 to maintain backwards-compatibility. (#23194)
This PR adds flag to enable InfluxDB v2 (--metrics.influxdbv2), flags for v2-specific features (--metrics.influxdb.token, --metrics.influxdb.bucket), also carries over addition of support for specifying organization (--metrics.influxdb.organization), but still retains backwards compatibility with InfluxDB v1.
This commit is contained in:
@ -28,6 +28,11 @@ type Config struct {
|
||||
InfluxDBUsername string `toml:",omitempty"`
|
||||
InfluxDBPassword string `toml:",omitempty"`
|
||||
InfluxDBTags string `toml:",omitempty"`
|
||||
|
||||
EnableInfluxDBV2 bool `toml:",omitempty"`
|
||||
InfluxDBToken string `toml:",omitempty"`
|
||||
InfluxDBBucket string `toml:",omitempty"`
|
||||
InfluxDBOrganization string `toml:",omitempty"`
|
||||
}
|
||||
|
||||
// DefaultConfig is the default config for metrics used in go-ethereum.
|
||||
@ -42,4 +47,10 @@ var DefaultConfig = Config{
|
||||
InfluxDBUsername: "test",
|
||||
InfluxDBPassword: "test",
|
||||
InfluxDBTags: "host=localhost",
|
||||
|
||||
// influxdbv2-specific flags
|
||||
EnableInfluxDBV2: false,
|
||||
InfluxDBToken: "test",
|
||||
InfluxDBBucket: "geth",
|
||||
InfluxDBOrganization: "geth",
|
||||
}
|
||||
|
Reference in New Issue
Block a user