Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF8: Content negotiation (encoding side) #2

Closed

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
expfmt/expfmt.go Outdated Show resolved Hide resolved
@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 <[email protected]>
more cleanup and simplification

Signed-off-by: Owen Williams <[email protected]>
Signed-off-by: Owen Williams <[email protected]>
Signed-off-by: Owen Williams <[email protected]>
Signed-off-by: Owen Williams <[email protected]>
@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