UTF-8 support in metric and label names#922
UTF-8 support in metric and label names#922fedetorres93 wants to merge 11 commits intoprometheus:mainfrom
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 <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
7707188 to
bd97179
Compare
Signed-off-by: Federico Torres <federico.torres@grafana.com>
|
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. |
|
Closing this PR due to staleness in favor of #1255 |
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-formatsmodule will use the new quoting syntax{"foo"}iff the metric does not conform to the legacy name format (foo{})prometheus-metrics-modelhas a new flag (NameValidationScheme) which determines if validation is done using the legacy or the UTF-8 schemeescaping=allow-utf-8in 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