Comments (6)
from client_java.
I'll start by implementing UTF-8 support in the Java client library
from client_java.
@fedetorres93 thanks for volunteering, I really appreciate that!
Is there any general guidance yet on how to implement it, for example how to convert UTF-8 names to Prometheus names for older Prometheus servers, and how to deal with potential name collisions when registering metrics?
It would be good to define the behavior first before implementing it. Ideally the behavior would be consistent across client libraries in all programming languages.
from client_java.
@fstab You can find the proposals @ywwg worked on here and here.
I'm working on adding UTF-8 metric and label name validations and support for parsing and formatting the UTF-8 text format, but there's still some discussion going on about the content negotiation implementation on writes and also regarding how the reads will be handled
from client_java.
Thanks @fedetorres93!
There is already support for dots in metric and label names in client_java
. It will be easy to extend this to other characters. The motivation for allowing dots was to support metric/label names defined in the OpenTelemetry semantic conventions.
Currently dots are only exposed in OpenTelemetry format. In Prometheus text format, OpenMetrics text format, and OpenMetrics protobuf format dots are replaced with underscores.
I assume for UTF-8 characters in Prometheus format we will define a new OpenMetrics version, right?
I think the following two considerations make sense:
- When converting OpenTelemetry names to Prometheus names follow the rules defined here: https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/. These are the rules that are also implemented in the OpenTelemetry collector. For a user it should not matter whether they scrape Prometheus format, or whether they push OpenTelemetry format and have a collector convert to Prometheus remote write. The resulting metric and attribute names should be the same, therefore Prometheus client libraries should implement the OpenTelemetry standard for converting arbitrary names to Prometheus names.
- Prometheus client libraries have a "fail fast" approach: When you register metrics with conflicting names, registration fails. We don't defer these errors to scrape time. I think we should look at the classic Prometheus names when checking for conflicts, i.e. we should fail if a user registers a metric named
requests.total
and then registers a metric namedrequests_total
. While this might theoretically work when exposing new names only, it will fail at scrape time for older Prometheus servers. We should consider this bad practice and prevent this in our client libraries.
What do you think? If you feel we should have a small "client library support for UTF-8" proposal with the points above I'm happy to write one.
from client_java.
Thanks for the info @fstab!
I don't think another proposal is necessary, but I appreciate the points you mentioned and will take them into account for the implementation.
from client_java.
Related Issues (20)
- The problem of java17 and Springboot3 use the doGet method in client_java.
- StatefulMetric.clear() is not implemented HOT 1
- Promethus Core Counter and Gauge Query HOT 2
- Metric `process_cpu_seconds_total` is in wrong order of magnitude HOT 1
- Added the ability to configured the HTTPServer socket timeout HOT 1
- PushGateway and JettyStatisticsCollector support in version 1 HOT 3
- Endpoint actuator/prometheus not working on macOS HOT 1
- Publish a BOM again
- Implement latest changes in the Prometheus Protobuf format
- [httpserver exporter] No option to specify a wait time for ongoing requests when closing the server HOT 3
- Explicit Exception for Duplicate Labels during Scrape HOT 1
- Stress test failure in DropwizardExportsTest HOT 2
- Stress test failure in SlidingWindowTest HOT 1
- dropwizard5 MapperConfig doesn't rename the metric? HOT 4
- How to remove all metrics in the defaultRegistry HOT 5
- Failing while building simpleclient_httpserver version parent-0.15.0 using mvn clean install HOT 4
- log4j2 instrumentation support for 1.X?
- Flaky test - SlidingWindowTest
- Filter parameter causes HTTP Status 400 – Bad Request HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client_java.