Skip to content

textfile: support UTF-8 metric and label names - #3729

Merged
ArthurSens merged 1 commit into
prometheus:masterfrom
U-S-jun:fix/textfile-utf8-names
Aug 21, 2026
Merged

textfile: support UTF-8 metric and label names#3729
ArthurSens merged 1 commit into
prometheus:masterfrom
U-S-jun:fix/textfile-utf8-names

Conversation

@U-S-jun

@U-S-jun U-S-jun commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Since #3405 updated prometheus/common to v0.66.1 and adapted the textfile parser to its explicit validation API, the parser has used LegacyValidation. This rejects quoted metric and label names that are valid under the current UTF-8 exposition format, including names containing dots.

Use UTF8Validation when parsing textfile input and add a regression test covering dotted metric and label names.

Legacy-compatible input remains accepted. The HTTP handler continues to use promhttp's existing name-escaping negotiation for scraper compatibility.

Testing

  • go test ./collector -run '^TestTextfileCollector(SupportsUTF8Names)?$' -count=1
  • go test -short ./...
  • GOOS=linux GOARCH=amd64 CGO_ENABLED=0 make lint
  • make test with Go 1.26 on Linux

Fixes #3700.

cc @SuperQ

@U-S-jun
U-S-jun marked this pull request as ready for review July 13, 2026 10:10
@U-S-jun

U-S-jun commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping @SuperQ — CI, lint, and BSD are still waiting for workflow approval, so the required checks have not started yet. Could someone with triage access approve them and take a look when convenient? Happy to rebase if preferred.

@ArthurSens

ArthurSens commented Aug 21, 2026

Copy link
Copy Markdown
Member

hey @U-S-jun , sorry for the delay here. Could you rebase the branch? We've migrated our CI a few weeks ago

Signed-off-by: USJUN <u.s.junn@gmail.com>
@U-S-jun
U-S-jun force-pushed the fix/textfile-utf8-names branch from 4102612 to d626b00 Compare August 21, 2026 13:15
@ArthurSens

Copy link
Copy Markdown
Member

/workflow-approve

@U-S-jun

U-S-jun commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest master and force-pushed. Thanks!

@ArthurSens ArthurSens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ArthurSens
ArthurSens merged commit 048741c into prometheus:master Aug 21, 2026
17 checks passed
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.

Metric names with dots

2 participants