-
Notifications
You must be signed in to change notification settings - Fork 3
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
Initial Micrometer 1.13.x migration recipe #11
Conversation
The migration from `io.prometheus.client.CollectorRegistry` to `io.prometheus.metrics.model.registry.PrometheusRegistry` is probably not covering _all_ cases. But for many code bases simply changing the type might be sufficient because `CollectorRegistry` and `PrometheusRegistry` have a very similar (and small) public api that essentially only offers a singleton - exposed as constant with equal names - and a constructor Partially resolves openrewrite#8
src/test/java/org/openrewrite/micrometer/UpgradeMicrometer13Test.java
Outdated
Show resolved
Hide resolved
…st.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…st.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Great start here @jjank ; thanks for your continued support of the project. These changes look great to me; We can include them in the Spring Boot 3.3 migration in rewrite-spring already to ensure users are at least seeing a start to the required changes. |
That makes sense (I see this is already refered to in openrewrite/rewrite-spring#526). I'd be happy to contribute this particular recipe to the Boot 3.3 migration after it's released. At some point it probably should be incorporated into the "generic" |
I've indeed linked the two right now ; in rewrite-spring I think it's best to include |
Great! The way our projects depend upon each other there's no need to wait for a release; rewrite-spring would be able to depend on this change already. Be sure to refresh your dependencies to pull down the latest snapshot from Sonatype OSS Snapshots, built from the main branch here. We wouldn't need more than just an added dependency + inclusion of the recipe there; we already tested the changes here. |
Cool, I'll give it a try right away 👍 |
* Add Micrometer 1.13.x migration recipe The migration from `io.prometheus.client.CollectorRegistry` to `io.prometheus.metrics.model.registry.PrometheusRegistry` is probably not covering _all_ cases. But for many code bases simply changing the type might be sufficient because `CollectorRegistry` and `PrometheusRegistry` have a very similar (and small) public api that essentially only offers a singleton - exposed as constant with equal names - and a constructor Partially resolves openrewrite#8 * Update src/test/java/org/openrewrite/micrometer/UpgradeMicrometer13Test.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/test/java/org/openrewrite/micrometer/UpgradeMicrometer13Test.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Loop in 1.13.x upgrade with the existing UpgradeMicrometer --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tim te Beek <[email protected]>
What's changed?
Initial work on Migrate to micrometer v1.13.+
What's your motivation?
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
@timtebeek
Any additional context
The migration from
io.prometheus.client.CollectorRegistry
toio.prometheus.metrics.model.registry.PrometheusRegistry
is probably not covering all cases.But for many code bases simply changing the type might be sufficient because
CollectorRegistry
andPrometheusRegistry
have a very similar (and small) public api that essentially only offers a singleton - exposed as constant with equal names - and a constructorChecklist