metrics: allow changing influxdb interval#33767
Merged
cskiraly merged 2 commits intoethereum:masterfrom Feb 23, 2026
Merged
Conversation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
rjl493456442
previously approved these changes
Feb 6, 2026
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)
|
jrhea
approved these changes
Feb 6, 2026
Contributor
Author
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>
MariusVanDerWijden
approved these changes
Feb 23, 2026
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this pull request
Feb 26, 2026
25 tasks
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.