-
Couldn't load subscription status.
- Fork 395
Micrometer Prometheus client v1.x breaking changes #2340
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: main
Are you sure you want to change the base?
Conversation
|
🎊 PR Preview 83f0c34 has been successfully built and deployed to https://quarkus-site-pr-2340-preview.surge.sh
|
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.
Pull Request Overview
This PR introduces a new documentation post detailing the migration paths and breaking changes resulting from the switch to Prometheus client v1 in the Micrometer registry.
- Introduces a new post explaining upgrade options and dependency changes
- Details specific changes to metrics naming and API usage
|
There is a plan change:
Will re-write the blog to reflect that. |
|
Re-wrote the post according to the new plan and zulip coments. |
|
This is on hold due to other ongoing work. |
Micrometer prometheus client v1.0 breaking changes
|
Updated the post. It's now ready to review. |
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.
I need to read it again on my machine (on my phone now).
We should also advertise the working group
|
|
||
| [INFO] | ||
| ==== | ||
| Users should move to the new `quarkus-micrometer-registry-prometheus-v1` extension. |
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.
Hold on, does this change the metrics? If so, sure they should move but be aware that they dashboards and alerts and queries are now incorrect
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.
Instead of info it should be inclined, in the flow of the required changes. We should invite the users to check the breaking change section before making a decision.
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.
sure, I can tone down the message, but they should work one migration, regardless. Will update.
| === Migration plan | ||
|
|
||
| 1. Keep current extension as is until Quarkus 4.0 (whenever that happens) so users can migrate at a time of their choice. | ||
| 2. Introduce a new extension called https://docs.quarkiverse.io/quarkus-micrometer-registry/dev/micrometer-registry-prometheus-v1.html[`quarkus-micrometer-registry-prometheus-v1`]. |
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.
What if you use both at the same time? What happens?
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.
In theory they could work at the same time but they will clash for sure because they will both try to publish the /q/metrics endpoint.
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.
Will test what happens.
| * `io.micrometer.prometheusmetrics.PrometheusMeterRegistry` must be used instead of the old `io.micrometer.prometheus.PrometheusMeterRegistry`. | ||
| * `io.prometheus.metrics.tracer.common.SpanContext` must be used instead of the old `io.prometheus.client.exemplars.ExemplarSampler` | ||
| * The new Prometheus client uses some reserved words that must not be used to name metrics, therefore some metrics were renamed. Some examples of reserved words and renamed metrics: | ||
| ** `info`. Before: `jvm_info_total`. Now: `jvm_total` |
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.
Do we have the list?
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.
I don't have a list.
I would need to activate all metrics in a big nr of extensions to get that. It can be done... But I would prefer not to because this is a pattern change that can be extrapolated without an exhaustive list.
|
|
||
| Other changes: | ||
|
|
||
| * Metrics must be registered always with the same tags. Micrometer will now send a warning if we register the same metric more than once with different Tag names. |
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.
I would separate these changes into 2 categories:
- metric format changes (type, name..)
- implementation changes
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.
ok
|
|
||
| Micrometer has become the default metrics framework in Quarkus due to its stability, maturity, and widespread adoption on the Java ecosystem — not https://quarkus.io/guides/opentelemetry-metrics[OpenTelemetry Metrics]. | ||
|
|
||
| Micrometer support in Quarkus is built on top af a main extension `quarkus-micrometer`, then specific registries extensions include it as a dependency and implement a registry sending out the telemetry. The Prometheus registry (`quarkus-micrometer-registry-prometheus`) is the default and most commonly used, and it is the focus of this announcement. |
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.
Of not af :-)
I can publicize this in that discussion but this is not part of the scope of that group. |
|
|
||
| 1. Keep current extension as is until Quarkus 4.0 (whenever that happens) so users can migrate at a time of their choice. | ||
| 2. Introduce a new extension called https://docs.quarkiverse.io/quarkus-micrometer-registry/dev/micrometer-registry-prometheus-v1.html[`quarkus-micrometer-registry-prometheus-v1`]. | ||
| 3. Remove current `quarkus-micrometer-registry-prometheus` on Quarkus 4.0 (no timeline at this moment) while providing an alternative on Quarkiverse. Quarkus users will get an additional migration period by using an upcoming community supported Quarkiverse extension. |
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.
That list looks like implementation tasks.
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.
They are, we are explaining what we are going to do next.
| ** Move the new https://docs.quarkiverse.io/quarkus-micrometer-registry/dev/micrometer-registry-prometheus-v1.html[`quarkus-micrometer-registry-prometheus-v1`] extension from Quarkiverse to Quarkus core repo and make it the default registry. | ||
| ** Refactor the https://quarkus.io/guides/telemetry-micrometer[`quarkus-micrometer`] extension tests to use the new client. | ||
|
|
||
| === Prometheus Client v1.x changes |
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.
Rename it to "breaking changes"
| * The new Prometheus client uses some reserved words that must not be used to name metrics, therefore some metrics were renamed. Some examples of reserved words and renamed metrics: | ||
| ** `info`. Before: `jvm_info_total`. Now: `jvm_total` | ||
| ** `duration`. Before: `http_server_requests_duration_seconds`. Now: `http_server_requests_seconds` | ||
| * Some metrics would display Tags ending in a comma (`,`). This tailing comma has now been removed. Example: `"hibernate_flushes_total{entityManagerFactory=\"<default>\",env=\"test\",env2=\"test\",registry=\"prometheus\",} 1.0"` |
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.
Why do we have the " ?
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.
It was just to delimit the String and it can go away.
| * Through the https://github.com/quarkiverse/quarkus-micrometer-registry/[Quarkiverse Micrometer registries] | ||
| * Via OpenTelemetry, using a bridge provided by the https://quarkus.io/guides/telemetry-micrometer-to-opentelemetry[Micrometer and OpenTelemetry] extension. This setup allows Micrometer metrics to be sent as OpenTelemetry metrics, offering a unified output via the https://opentelemetry.io/docs/specs/otlp/[OpenTelemetry OTLP protocol]. | ||
|
|
||
| For more details on Observability in Quarkus please visit https://quarkus.io/guides/observability[this guide]. |
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.
Question: do all these ways use the same metric conventions?
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.
No, Micrometer and OpenTelemetry follow different semantic conventions, however, Micrometer metrics telemetry going out through the quarkus-micrometer-opentelemetry extension will keep the Micrometer semantic conventions alignment. It's not 1:1 but close and documented here: https://quarkus.io/guides/telemetry-micrometer-to-opentelemetry#semantic-convention-differences
Probably worth mentioning it... Will update.
|
|
||
| The prometheus client is not the only option to send out telemetry, there are alternative options such as the Quarkiverse registries or our OpenTelemetry bridge. | ||
|
|
||
| You can follow Quarkus release dates here: https://github.com/quarkusio/quarkus/wiki/Release-Planning |
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.
I would remove this sentence.
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.
It's just because we mention a future version with no estimated date, at least, they can keep an eye here... You still think we should remove it?

This is a blog post to communicate the Micromenter Prometheus client v1.x changes.