Skip to content

cmd/utils: keep metrics tag values containing '='#35168

Open
cuiweixie wants to merge 1 commit into
ethereum:masterfrom
cuiweixie:fix/splittags-value-with-equals
Open

cmd/utils: keep metrics tag values containing '='#35168
cuiweixie wants to merge 1 commit into
ethereum:masterfrom
cuiweixie:fix/splittags-value-with-equals

Conversation

@cuiweixie

Copy link
Copy Markdown
Contributor

SplitTagsFlag split each "k=v" tag on every "=" with strings.Split, producing more than two parts whenever the value itself contained an "=" (e.g. build=release=2026). Such a tag failed the len(kv) == 2 check and was silently dropped.

Use strings.SplitN(t, "=", 2) so the split happens only on the first "=", keeping the remainder as the value. A tag list like 'host=node1,build=release=2026' now retains the build tag.

SplitTagsFlag split each "k=v" tag on every "=" with strings.Split,
producing more than two parts whenever the value itself contained an
"=" (e.g. build=release=2026). Such a tag failed the len(kv) == 2 check
and was silently dropped.

Use strings.SplitN(t, "=", 2) so the split happens only on the first
"=", keeping the remainder as the value. A tag list like
'host=node1,build=release=2026' now retains the build tag.
@MariusVanDerWijden MariusVanDerWijden added this to the 1.17.4 milestone Jun 14, 2026
@rjl493456442

Copy link
Copy Markdown
Member
--- FAIL: Test_SplitTagsFlag (0.00s)
    --- FAIL: Test_SplitTagsFlag/garbage (0.00s)
        flags_test.go:62: splitTagsFlag() = map[smth:smthelse=123], want map[]
FAIL

@fjl fjl modified the milestones: 1.17.4, 1.17.5 Jun 22, 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