-
Notifications
You must be signed in to change notification settings - Fork 998
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
Support prometheus client 1.x #4406
Comments
This is related: #3987 |
Any chance the v1 client might improve the situation with #877 ? |
It's possible. We'll revisit that when we've figured out the details of the upgrade. |
Dependencies were upgraded to the 1.x versions of the Prometheus client artifacts in micrometer-registry-prometheus. This is a breaking change compared to the code that was there before. This is unavoidable due to the breaking changes in the Prometheus client from 0.x to 1.x. The previous code from micrometer-registry-prometheus was moved to a new module micrometer-registry-prometheus-simpleclient that is deprecated but available to give users a backward compatible option in case they need to make changes to use the new Prometheus client. The base package used in micrometer-registry-prometheus was changed to io.micrometer.prometheusmetrics to differentiate it from the prior package now used in micrometer-registry-prometheus-simpleclient. This avoids split packages and allows both modules to be used in the same application even. Tests were adapted to the new API and differences in the scrape output. Tests involving exemplars are commented out until exemplar support is added. PrometheusHistogram's cumulative buckets were converted to delta in the registry. The new Prometheus client wants delta buckets which is weird since it converts them back to cumulative internally. PrometheusNamingConvention behavior was changed, it does not append "_total" to counters anymore. The new Prometheus client validates Counter names and check if they end with "_total". If they don't, it appends "_total". If they do, it throws an exception: java.lang.IllegalArgumentException: 'cnt_total': Illegal metric name... Because of this behavior, if we want to use PrometheusNamingConvention, we need to modify it so that it does not append "_total". Known issues in the micrometer-registry-prometheus module after this PR: - Exemplars and Native Histograms do not work. - VictoriaMetrics histograms are not supported. - The OSGi test was failing when the new Prometheus client was used, so it was updated to use the -simpleclient module for now. See micrometer-metricsgh-3987 See micrometer-metricsgh-4406 Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com>
Dependencies were upgraded to the 1.x versions of the Prometheus client artifacts in micrometer-registry-prometheus. This is a breaking change compared to the code that was there before. This is unavoidable due to the breaking changes in the Prometheus client from 0.x to 1.x. The previous code from micrometer-registry-prometheus was moved to a new module micrometer-registry-prometheus-simpleclient that is deprecated but available to give users a backward compatible option in case they need to make changes to use the new Prometheus client. The base package used in micrometer-registry-prometheus was changed to io.micrometer.prometheusmetrics to differentiate it from the prior package now used in micrometer-registry-prometheus-simpleclient. This avoids split packages and allows both modules to be used in the same application even. Tests were adapted to the new API and differences in the scrape output. Tests involving exemplars are commented out until exemplar support is added. PrometheusHistogram's cumulative buckets were converted to delta in the registry. The new Prometheus client wants delta buckets which is weird since it converts them back to cumulative internally. PrometheusNamingConvention behavior was changed, it does not append "_total" to counters anymore. The new Prometheus client validates Counter names and check if they end with "_total". If they don't, it appends "_total". If they do, it throws an exception: java.lang.IllegalArgumentException: 'cnt_total': Illegal metric name... Because of this behavior, if we want to use PrometheusNamingConvention, we need to modify it so that it does not append "_total". Known issues in the micrometer-registry-prometheus module after this PR: - Exemplars and Native Histograms do not work. - VictoriaMetrics histograms are not supported. - The OSGi test was failing when the new Prometheus client was used, so it was updated to use the -simpleclient module for now. See gh-3987 See gh-4406 Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com>
Fyi: we added initial support for this (see the PR description, TL;DR: exemplars and native histograms do not work yet): #4846. |
Here is my initial feedback. Since the current spring-boot auto-configuration is based on the old simpleclient, it's not straight forward to test the new implementation. I used the following configuration which registers the
I spotted another illegal metric name:
After I disabled the JVM metrics (using I haven't currently analyzed the scrape output for other incompatibilities or feed it into prometheus. |
Most notably difference in the scrape output is a change in the names of TYPE summary metrics. Is this expected with the new client? It seems in line with https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md Old (Simpleclient)
New Client
|
@cachescrubber thank you for trying things out and giving feedback. It's very appreciated. We are aware of the issues you pointed out, and we should capture them in an upgrade guide. Thanks for writing them out; that will make it easier to write the guide for other users to follow. We were hoping to get auto-config support into Boot in the milestone that was just released, but unfortunately we weren't able to get it in. The current plan is for exemplar support and auto-configuration to be worked out in time for RC1. The jvm_info issue should be fixed in snapshots when #4866 is merged. The change to the LongTaskTimer timeseries' name in Prometheus output is a breaking change that aligns it with what Prometheus convention expects (but we were never doing). We may take another look at what we could/should be doing there. Conceptually LTTs are GaugeHistograms, but Prometheus format doesn't have this concept - only OpenMetrics does. |
@cachescrubber Thank you very much!
We already have a draft PR for Boot: spring-projects/spring-boot#40023 as Tommy mentioned above, we hope we can have this in Boot 3.3.0-RC1.
I think that might be the simplest way to try this out with Boot. Fyi: I merged #4866 in so if you use the latest On top of what Tommy said about the breaking changes around The next thing is adding Exemplars support and updating the Boot PR with the new bits: #4867 |
I think this should be closed since these were merged in superseding this issue:
Future improvements: |
Please describe the feature request.
Prometheus Client 1.x releases differ from the 0.16 release.
Rationale
Use the v1 release instead of the v0 releases.
Additional context
The text was updated successfully, but these errors were encountered: