Skip to content

UTF8: Content negotiation (encoding side)#2

Closed
ywwg wants to merge 31 commits intoowilliams/quoted-metric-namefrom
owilliams/quoted-metric-name-02
Closed

UTF8: Content negotiation (encoding side)#2
ywwg wants to merge 31 commits intoowilliams/quoted-metric-namefrom
owilliams/quoted-metric-name-02

Conversation

@ywwg
Copy link
Owner

@ywwg ywwg commented Dec 28, 2023

This PR builds on prometheus#537 by adding content negotation during scraping.

Scrapers can announce that they support utf-8 names by adding "validchars=utf8" in the Content-Type header. In cases where utf8 is not available, metric providers can be configured to escape names in a few different ways: values (U__ utf value escaping for perfect round-tripping), underscores (all invalid chars become _), dots (dots become dot, _ becomes __, all other values become __).

This is still a noop for existing configurations because scrapers will not be passing the validchars key in the Content-Type header. Existing functionality is maintained.

@ywwg ywwg changed the title start on content negotiation UTF8: Content negotiation (encoding side) Dec 28, 2023
@ywwg ywwg force-pushed the owilliams/quoted-metric-name branch 2 times, most recently from cbd00f5 to 0940b71 Compare January 11, 2024 14:24
ywwg and others added 24 commits January 23, 2024 16:24
…eus#537)

UTF-8 support in validation, and some parsers and formatters

---------

Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
more cleanup and simplification

Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
@ywwg ywwg force-pushed the owilliams/quoted-metric-name-02 branch from eef9af4 to f4d7f87 Compare January 23, 2024 15:59
@ywwg ywwg closed this Jan 23, 2024
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.

1 participant