Uh oh!
There was an error while loading. Please reload this page.
UTF-8 support in metric and label names - #1255
Conversation
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Federico Torres <federico.torres@grafana.com>
fedetorres93
commented
Jan 9, 2025
Given the ongoing discussion about unit suffixes for OM 2.0 (prometheus/OpenMetrics#286), I think we can take this UTF-8 work as a basis and then add the necessary changes to comply with the final consensus on suffixes. |
Signed-off-by: Federico Torres <federico.torres@grafana.com>
zeitlinger
commented
Jan 22, 2025
@fstab are you ok with that? |
Update: The |
fedetorres93
commented
Feb 14, 2025
@fstab Good to know, thanks for the update! |
fedetorres93
commented
Apr 10, 2025
Hello @fstab, I just wanted to follow-up on your last comment. Seems like OM 2.0 is still under discussion, so do you think now is a good time to reconsider merging this PR? |
We have our |
zeitlinger
commented
Apr 15, 2025
@fedetorres93 thanks for the PR! let me start with some high level questions before an in-depth review:
|
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>
fedetorres93
commented
Jul 25, 2025
@zeitlinger Thanks for the feedback. I made the statics in About adding a setting in |
zeitlinger
commented
Aug 4, 2025
I can't find that |
zeitlinger
left a comment
There was a problem hiding this comment.
great - I think I get it now 😄
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
zeitlinger
commented
Aug 4, 2025
for formatting, checkstyle issues see CONTRIBUTING.md |
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: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
# Conflicts: # prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterPushgatewayProperties.java # prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java # prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.java # prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java # prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java # prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusTextFormatWriter.java # prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/TextFormatUtil.java # prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/GaugeSnapshot.java # prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricMetadata.java # prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/UnknownSnapshot.java
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
fstab
left a comment
There was a problem hiding this comment.
I found one prometheus.properties file that I think is not needed anymore, otherwise it looks great 🎉
Thanks a lot everyone!
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Uh oh!
There was an error while loading. Please reload this page.
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-modelmodule has a new flag (nameValidationScheme) that determines if validation is done using the legacy or the UTF-8 scheme. This flag can be set via a property in the properties file.escaping=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 has a global default (PrometheusNaming.DEFAULT_ESCAPING_SCHEME) 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.
prometheus-metrics-exporter-pushgatewaymodule will escape UTF-8 grouping keys in the URL path used when pushing metrics (see Add UTF-8 support in metric and label names pushgateway#689)Work towards prometheus/prometheus#13095