Skip to content

Conversation

simonpasquier
Copy link

This commit adds a new metric to test UTF-8 metrics with Prometheus.

Example

$ curl  -H "Accept: text/plain;version=1.0.0;escaping=allow-utf-8" localhost:8080/metrics
(following the OpenTelemetry semantic conventions)
{"http.server.requests","http.request.method"="get"} 171
{"http.server.requests","http.request.method"="post"} 167
...

This commit adds a new metric to test UTF-8 metrics with Prometheus.

Example

```
$ curl  -H "Accept: text/plain;version=1.0.0;escaping=allow-utf-8" localhost:8080/metrics
(following the OpenTelemetry semantic conventions)
{"http.server.requests","http.request.method"="get"} 171
{"http.server.requests","http.request.method"="post"} 167
...
```
Copy link

@machine424 machine424 left a comment

Choose a reason for hiding this comment

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

It’s a good idea to include this as part of the same app.
LGTM
IIUC, we can only make use of this in e2e and docs once the stack fully supports utf-8?

@simonpasquier
Copy link
Author

IIUC, we can only make use of this in e2e and docs once the stack fully supports utf-8?

We can (should be able to) use it now to ensure that Prometheus translates utf-8 strings to their legacy form (e.g. replacing invalid chars by _).

@machine424
Copy link

IIUC, we can only make use of this in e2e and docs once the stack fully supports utf-8?

We can (should be able to) use it now to ensure that Prometheus translates utf-8 strings to their legacy form (e.g. replacing invalid chars by _).

AFAIK, the schemes only control what Prometheus will ask for via the Accept header during scraping. It's up to the target to return the appropriate format.

@simonpasquier
Copy link
Author

Yes sorry for the misunderstanding on my side! What I wanted to say is that we can merge it now because it shouldn't break any test and it will help us validating proper utf-8 support once available in the stack.

@simonpasquier simonpasquier merged commit 3a3ae13 into rhobs:master Oct 1, 2025
2 checks passed
@simonpasquier simonpasquier deleted the add-utf8-counter branch October 1, 2025 12:40
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.

2 participants