-
Notifications
You must be signed in to change notification settings - Fork 804
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
UTF-8 support in metric and label names #922
base: main
Are you sure you want to change the base?
UTF-8 support in metric and label names #922
Conversation
Hello @fedetorres93, thanks for working on this. I noticed this is still a draft, but I have a few general comments, unrelated to specific code lines:
|
Part of the content negotiation is a new term, |
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
Signed-off-by: Federico Torres <[email protected]>
7707188
to
bd97179
Compare
Signed-off-by: Federico Torres <[email protected]>
Hello @fstab, I see that there's still some discussion going on about OpenTelemetry metric names conversion, but I think that the PR is ready for an initial review, at least until a consensus is reached. |
Hey @fstab, I just wanted to check in regarding this PR. I understand there might still be ongoing talks about the OpenTelemetry metric names conversion, but I was wondering if you had a chance to take an initial look. Looking forward to any feedback you might have. |
Adds UTF-8 support for metric and label names.
These changes are based on the work done on the Prometheus common libraries here and here
prometheus-metrics-exposition-formats
module will use the new quoting syntax{"foo"}
iff the metric does not conform to the legacy name format (foo{}
)prometheus-metrics-model
has a new flag (NameValidationScheme
) which determines if validation is done using the legacy or the UTF-8 schemeescaping=allow-utf-8
in the Accept header. In cases where UTF-8 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___
). Escaping can either be a global default (PrometheusNaming.nameEscapingScheme
) or can also be specified in Accept header with theescaping=
term, which can beallow-utf-8
(for UTF-8-compatible),underscores
,dots
, orvalues
.This should still be a noop for existing configurations because scrapers will not be passing the escaping key in the Accept header. Existing functionality is maintained.
Work towards prometheus/common#527