Skip to content

Support additional Prometheus UTF-8 escaping schemes #7246

@martincostello

Description

@martincostello

Prometheus supports four different metric and label name escaping schemes (see UTF-8 metric and label name escaping schemes):

The default behaviour is to use underscores, which is what #7209 implements:

If no escaping scheme is specified in the Accept header, underscores escaping SHOULD be used.

The default Accept header sent by Prometheus is:

Accept: application/openmetrics-text;version=1.0.0;escaping=allow-utf-8;q=0.5,application/openmetrics-text;version=0.0.1;q=0.4,text/plain;version=1.0.0;escaping=allow-utf-8;q=0.3,text/plain;version=0.0.4;q=0.2,/;q=0.1

As shown above, and because it is listed first, escaping=allow-utf-8 is the preferred scheme to use.

At a minimum we should support escaping=allow-utf-8 when specified by the client with a fallback to escaping=underscores.

Metadata

Metadata

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions