Skip to content

Conversation

@FUSAKLA
Copy link
Owner

@FUSAKLA FUSAKLA commented Oct 31, 2024

fixes #88

  • enable UTF-8 support in label and metric names by default
  • add validator to disallow using the UTF-8 (this should be used as a default for now, UTF-8 support is still in early stages in Prometheus)

this change will probably result into new major version, since the UTF-8 support might be breaking

Signed-off-by: Martin Chodur [email protected]

@FUSAKLA
Copy link
Owner Author

FUSAKLA commented Oct 31, 2024

@jmichalek132 would you give it a try? 🙏

Signed-off-by: Martin Chodur <[email protected]>
@jmichalek132
Copy link
Contributor

FYI with Prometheus 3.X UTF-8 support is enabled by default, but some backends like Mimir / Cortex / Thanos might not support it yet.

and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Change: :warning: Enable UTF-8 support in metic and label names by default. To disallow usage of UTF-8 characters in metric and label names use the new validator [`doesNotUseUTF8`](./docs/validations.md#doesnotuseutf8).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Change: :warning: Enable UTF-8 support in metic and label names by default. To disallow usage of UTF-8 characters in metric and label names use the new validator [`doesNotUseUTF8`](./docs/validations.md#doesnotuseutf8).
- Change: :warning: Enable UTF-8 support in metric and label names by default. To disallow usage of UTF-8 characters in metric and label names use the new validator [`doesNotUseUTF8`](./docs/validations.md#doesnotuseutf8).

Copy link
Contributor

@jmichalek132 jmichalek132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 2 small comments left.

@jmichalek132
Copy link
Contributor

Given the UTF-8 support was added to better support OTEL metrics, and the only character that was not allowed in Prometheus but is commonly used in OTEL is dot, it might be worth considering adding a validation that allows Prometheus charset + dot, without allowing other UTF-8 characters.


## [Unreleased]
- Change: :warning: Enable UTF-8 support in metic and label names by default. To disallow usage of UTF-8 characters in metric and label names use the new validator [`doesNotUseUTF8`](./docs/validations.md#doesnotuseutf8).
- Added: new validator [`doesNotUseUTF8`](./docs/validations.md#doesnotuseemoji) to check if the metric and label names do not use UTF-8 characters.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to add this specific type of utf8 character as opposed to any of the other blocks? It seems arbitrary. (Why not also exclude arrows or other symbols?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for utf-8 🎉🎉🎉🎉🎉

4 participants