Skip to content
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

Integrating Native Histograms with Spring 2.7.x and Prometheus client_java 1.3.1: Challenges in Writing Native Histograms to Response Object #973

Open
kiransunkari opened this issue Jul 22, 2024 · 0 comments

Comments

@kiransunkari
Copy link

We are exploring native histograms in Prometheus and we are using Spring 2.7.x. Our existing monitoring dashboards rely on the default metrics exposed by Spring. Therefore, we need to include both the default Spring metrics exposed by the spring-micrometer and custom native histograms from the Prometheus client_java library because Micrometer in Spring does not yet support native histograms.

I have created native histograms and tried to expose them at a new endpoint, /metrics. The challenge is that I need to write the native histogram data to the response object in text format.

For classic histograms, I used the TextFormat from the Prometheus simple client library. But in the latest 1.3.1 version of the client_java library, metrics are coming as MetricSnapshots. I need an API to convert MetricSnapshots which contains native histograms to text format.

I explored the Prometheus-metrics-exposition-format library to convert MetricSnapshots to text format. However, this library does not support exporting native histograms to text format. Only the PrometheusProtoBuffFormatter considers native histograms while exporting to the protobuff format.

P.S.: I know native histograms are still an experimental feature, but I'm asking this question here in case someone has already achieved this.

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

No branches or pull requests

1 participant