Skip to content

metrics: allow changing influxdb interval#33767

Merged
cskiraly merged 2 commits intoethereum:masterfrom
cskiraly:influxdb-interval
Feb 23, 2026
Merged

metrics: allow changing influxdb interval#33767
cskiraly merged 2 commits intoethereum:masterfrom
cskiraly:influxdb-interval

Conversation

@cskiraly
Copy link
Copy Markdown
Contributor

@cskiraly cskiraly commented Feb 5, 2026

The PR exposes the InfuxDB reporting interval as a CLI parameter, which was previously fixed 10s.
Default is still kept at 10s.
Note that decreasing the interval comes with notable extra traffic and load on InfluxDB.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
rjl493456442
rjl493456442 previously approved these changes Feb 6, 2026
@rjl493456442
Copy link
Copy Markdown
Member

We can sanitize the interval if it's too small.

diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index d6e8112bee..87c9567b3d 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -2178,6 +2178,13 @@ func SetupMetrics(cfg *metrics.Config) {
 		tagsMap      = SplitTagsFlag(cfg.InfluxDBTags)
 		interval     = cfg.InfluxDBInterval
 	)
+
+	// Sanitize the report interval
+	if interval < time.Second {
+		log.Warn("Sanitizing influxDB report interval", "provided", common.PrettyDuration(interval), "updated", common.PrettyDuration(time.Second))
+		interval = time.Second
+	}
+
 	if enableExport {
 		log.Info("Enabling metrics export to InfluxDB", "interval", interval)
 		go influxdb.InfluxDBWithTags(metrics.DefaultRegistry, interval, endpoint, database, username, password, "geth.", tagsMap)

@cskiraly
Copy link
Copy Markdown
Contributor Author

We can sanitize the interval if it's too small.

Why would we do that, and why set to min 1 second? If you set this low, my assumption would be that you do it on purpose.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
@cskiraly cskiraly added this to the 1.17.1 milestone Feb 23, 2026
@cskiraly cskiraly merged commit d3dd48e into ethereum:master Feb 23, 2026
7 of 8 checks passed
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Feb 26, 2026
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Feb 26, 2026
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Feb 26, 2026
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Mar 3, 2026
AnilChinchawale pushed a commit to XinFinOrg/XDPoSChain that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants