You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds UTF-8 support for metric and label names.
These changes are based on the work done on the Prometheus common
libraries [here](prometheus/common#537) and
[here](prometheus/common#570)
- The `prometheus-metrics-exposition-formats` module will use the new
quoting syntax `{"foo"}` iff the metric does not conform to the legacy
name format (`foo{}`)
- The `prometheus-metrics-model` module 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.
- Scrapers can announce via content negotiation that they support UTF-8
names by adding `escaping=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 has a global default
(`PrometheusNaming.DEFAULT_ESCAPING_SCHEME`) or can also be specified in
Accept header with the `escaping=` term, which can be `allow-utf-8` (for
UTF-8-compatible), `underscores`, `dots`, or `values`.
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.
- The `prometheus-metrics-exporter-pushgateway` module will
[escape](https://github.com/prometheus/proposals/blob/main/proposals/2023-08-21-utf8.md#text-escaping)
UTF-8 grouping keys in the URL path used when pushing metrics (see
prometheus/pushgateway#689)
Work towards prometheus/prometheus#13095
---------
Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Co-authored-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
0 commit comments