Skip to content

Conversation

dukelion
Copy link

@dukelion dukelion commented Aug 9, 2025

…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.

@dukelion dukelion force-pushed the ModernPrometheusClient branch 2 times, most recently from 4f1edf8 to c4c1c26 Compare August 9, 2025 16:52
@dukelion dukelion marked this pull request as draft August 10, 2025 13:48
@dukelion dukelion force-pushed the ModernPrometheusClient branch 3 times, most recently from 0ae14e7 to 5b39d5c Compare August 11, 2025 14:45
@dukelion dukelion marked this pull request as ready for review August 11, 2025 15:13
@dukelion
Copy link
Author

dukelion commented Aug 11, 2025

@kezhuw @anmolnar @eolivelli please have a look. I'm not sure why CI is failing.

UPD: just rebasing it fixed the test

…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
@dukelion dukelion force-pushed the ModernPrometheusClient branch from 5b39d5c to 0d2ab08 Compare August 15, 2025 08:53
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.

1 participant