-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ZOOKEEPER-4741: Modernize PrometheusMetricsProvider with Jetty and ne… #2291
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
base: master
Are you sure you want to change the base?
Conversation
4f1edf8 to
c4c1c26
Compare
0ae14e7 to
5b39d5c
Compare
|
@kezhuw @anmolnar @eolivelli please have a look. I'm not sure why CI is failing. UPD: just rebasing it fixed the test |
5b39d5c to
0d2ab08
Compare
anmolnar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite cool. Thanks for the great work!
Could you please rebase the patch to latest master?
| /** | ||
| * A Metrics Provider implementation based on https://prometheus.io. | ||
| * | ||
| * This implementation uses the prometheus-java-client library (version 1.x) and exposes metrics via an embedded Jetty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might not want to include any version number in Javadoc, because it could become outdated pretty quickly and will be misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! Rebased and addressed your comment.
…w client
In production environments under heavy load, the existing
PrometheusMetricsProvider can introduce high latency. This is largely
due to its use of the outdated `io.prometheus.client` (simpleclient 0.x)
library and its basic, built-in HTTPServer, which has limitations in
server configuration and threading.
This commit modernizes the entire component to address these
performance and maintainability issues by:
1. **Upgrading to the `io.prometheus.metrics` (client_java 1.x) library.**
This aligns the provider with the current standard for Prometheus
instrumentation in Java and ensures future compatibility.
2. **Replacing the legacy server and threading model with an embedded
Jetty server.** The previous implementation used a custom thread
pool for a metrics processing task queue, which is now obsolete in
the new client library. This has been replaced with a robust Jetty
server, which uses its own configurable thread pool to handle
exporter servlet requests directly. This change improves stability
and simplifies the threading model, resolving the latency issues
under load.
These changes make the PrometheusMetricsProvider more stable,
performant, maintainable, and easier to configure for production use.
This resolves CI pipeline failures due to java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big
6b78307 to
73a06a7
Compare
|
@dukelion Thanks! Please fix the compile error. |
…w client
In production environments under heavy load, the existing PrometheusMetricsProvider can introduce high latency. This is largely due to its use of the outdated
io.prometheus.client(simpleclient 0.x) library and its basic, built-in HTTPServer, which has limitations in server configuration and threading.This commit modernizes the entire component to address these performance and maintainability issues by:
Upgrading to the
io.prometheus.metrics(client_java 1.x) library. This aligns the provider with the current standard for Prometheus instrumentation in Java and ensures future compatibility.Replacing the legacy server and threading model with an embedded Jetty server. The previous implementation used a custom thread pool for a metrics processing task queue, which is now obsolete in the new client library. This has been replaced with a robust Jetty server, which uses its own configurable thread pool to handle exporter servlet requests directly. This change improves stability and simplifies the threading model, resolving the latency issues under load.
These changes make the PrometheusMetricsProvider more stable, performant, maintainable, and easier to configure for production use.