Skip to content

Epic: Prometheus: Support UTF-8 metrics and labels #91253

@itsmylife

Description

@itsmylife

lezer-promql support UTF-8 labels. See: prometheus/prometheus#13590

parsing.ts and situation.ts should also support new changes.

In this PR (#91252) we only made the changes for backward compatibility.

UTF-8 Support in a nutshell:

Reference: prometheus/prometheus#13095
Proposal: https://github.com/prometheus/proposals/blob/main/proposals/2023-08-21-utf8.md

For a utf8 metrics the query must be written the following way

Standart prometheus query:
http_request_duration_seconds_sum{method="GET"}

utf8 query
{"http.request_duration_seconds_sum", method="GET", "utf8.label"="value"}
  • utf8 metric must be the first place in the curly braces and inside the quotes.
  • utf8 label wrapped with quotes

How to test/review

Each PR for each issue is another PRs parent. I split them that way to make review easy. The scope of each issue is defined. So no need to test other things when you are checking a certain PR.

For dev environment simply run make devenv sources=prometheus it will give you utf8 metrics out of the box.

Standart prometheus query:
http_request_duration_seconds_sum{method="GET"}

utf8 query
{"http.request_duration_seconds_sum", method="GET", "utf8.label"="value"}

So review the issues top to bottom please.

⚠️ Disclaimer:

⚠️ This issues and PRs require prometheus v3.1.0 as a minimum version.

Sub-issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions