Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: Implement UTF-8 character support for label and metric names #13095

Open
5 of 24 tasks
ywwg opened this issue Nov 3, 2023 · 5 comments
Open
5 of 24 tasks

Epic: Implement UTF-8 character support for label and metric names #13095

ywwg opened this issue Nov 3, 2023 · 5 comments
Assignees
Milestone

Comments

@ywwg
Copy link
Contributor

ywwg commented Nov 3, 2023

Tracking Issue

Relates to:

Original discussion
Brainstorming doc Quoting Prometheus Names
OTEL Attribute compatibility section

We are creating this issue as part of the OTEL Support milestone so it will be OTEL oriented but the problem is general to prometheus and has been around for a long time.

OTel allows UTF-8 in label names while Prometheus has a much more restrictive set. This is causing friction for users when using Prometheus. In particular, . (dot) is a very common character in OTel and we convert that to _ when converting to Prometheus. For example, service.version becomes service_version.

Proposals have been accepted to do this work:

Write-side tasks:

Read-side tasks:

Client Libraries:

Grafana user-visible changes:

Not directly related to Prometheus, but this is the bug I'm using for all the related work, so...

Other task refs:

(This is a clone of #12630 that I own so I can edit the top-level comment and track work here)

@ywwg
Copy link
Contributor Author

ywwg commented Nov 3, 2023

Design work will be needed for the tsdb changes -- determining how to query data that was written with old versions of prometheus will be tricky, for instance if an Otel metric goes from _ to . but doesn't use the U__ quoting syntax in the old metrics.

@gouthamve gouthamve added this to the OTEL Support milestone Nov 3, 2023
@spedersen-emailage
Copy link

Ran into this issue with Grafana alert labels vs. Prometheus alert labels. Grafana supports -, but Prometheus does not. In order to avoid conflicts or multiple label sets, we'll need to replace - with _ in all of our alerts and notification policies next week.

Consistency between OTel, Prometheus, etc. would be fantastic.

@ywwg
Copy link
Contributor Author

ywwg commented Jan 11, 2024

prometheus/common#537 in progress (name validation, exposition parsers)

@ywwg
Copy link
Contributor Author

ywwg commented Jan 11, 2024

ywwg/common#2 in draft (write-side content negotiation)

@ywwg ywwg changed the title Implement UTF-8 character support for label and metric names Epic: Implement UTF-8 character support for label and metric names Jan 12, 2024
ywwg added a commit to ywwg/prometheus that referenced this issue Feb 15, 2024
This adds support for the new grammar of `{"metric_name", "l1"="val"}` to promql and some of the exposition formats.
This grammar will also be valid for non-UTF-8 names.
UTF-8 names will not be considered valid unless model.NameValidationScheme is changed.

This does not update the go expfmt parser in text_parse.go, which will be addressed by prometheus/common#554.

Part of prometheus#13095

Signed-off-by: Owen Williams <owen.williams@grafana.com>
ywwg added a commit to ywwg/prometheus that referenced this issue Feb 15, 2024
This adds support for the new grammar of `{"metric_name", "l1"="val"}` to promql and some of the exposition formats.
This grammar will also be valid for non-UTF-8 names.
UTF-8 names will not be considered valid unless model.NameValidationScheme is changed.

This does not update the go expfmt parser in text_parse.go, which will be addressed by prometheus/common#554.

Part of prometheus#13095

Signed-off-by: Owen Williams <owen.williams@grafana.com>
paveldroo pushed a commit to paveldroo/prometheus that referenced this issue Feb 21, 2024
This adds support for the new grammar of `{"metric_name", "l1"="val"}` to promql and some of the exposition formats.
This grammar will also be valid for non-UTF-8 names.
UTF-8 names will not be considered valid unless model.NameValidationScheme is changed.

This does not update the go expfmt parser in text_parse.go, which will be addressed by prometheus/common#554.

Part of prometheus#13095

Signed-off-by: Owen Williams <owen.williams@grafana.com>
aknuds1 pushed a commit to grafana/mimir-prometheus that referenced this issue Feb 26, 2024
This adds support for the new grammar of `{"metric_name", "l1"="val"}` to promql and some of the exposition formats.
This grammar will also be valid for non-UTF-8 names.
UTF-8 names will not be considered valid unless model.NameValidationScheme is changed.

This does not update the go expfmt parser in text_parse.go, which will be addressed by prometheus/common#554.

Part of prometheus/prometheus#13095

Signed-off-by: Owen Williams <owen.williams@grafana.com>
@mhausenblas
Copy link

Thanks for this! Question concerning "User-visible changes:" section. Should we take into account CNCF projects such as Thanos and Cortex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

5 participants