pushgateway icon indicating copy to clipboard operation
pushgateway copied to clipboard

Add UTF-8 support in metric and label names

Open fedetorres93 opened this issue 1 year ago • 2 comments

As part of the initiative for adding UTF-8 support to Prometheus, this PR brings UTF-8 support for metric and label names as described in this proposal (for example: {"metric.name", "label.name"="value"}.

For UTF-8 label names defined in the URL path, an escaping syntax is used. For example, the label "label.name"="value" would be escaped like: /metrics/job/example/U__label_2e_name/value. This escaping is compatible with the base64 encoding for label values: /metrics/job/example/U__label_2e_name@base64/dmFsdWU=

UTF-8 support can be enabled by running the Pushgateway with the flag --push.enable-escaped-labels=true

Addresses https://github.com/prometheus/pushgateway/issues/623

fedetorres93 avatar Sep 12 '24 15:09 fedetorres93

Sorry, still fighting my backlog. I hope I get to review this tomorrow.

beorn7 avatar Sep 18 '24 16:09 beorn7

@beorn7 Thanks for your feedback, the requested changes were addressed.

fedetorres93 avatar Sep 23 '24 21:09 fedetorres93

@beorn7 Sorry about the documentation, thanks for pointing it out, now it's added. Also added EscapingScheme comment.

fedetorres93 avatar Sep 25 '24 21:09 fedetorres93

@beorn7 Thanks for the docs suggestions, done.

fedetorres93 avatar Sep 27 '24 14:09 fedetorres93