You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "barry3406 (via GitHub)" <gi...@apache.org> on 2026/04/11 05:44:05 UTC
[PR] Fix #16109: support Micrometer 1.13+ Prometheus package in MetricsSupportUtil [dubbo]
barry3406 opened a new pull request, #16205:
URL: https://github.com/apache/dubbo/pull/16205
## What is the purpose of the change?
Fixes #16109. `MetricsSupportUtil.isSupportPrometheus()` currently only looks for `io.micrometer.prometheus.PrometheusConfig`, which was renamed to `io.micrometer.prometheusmetrics.PrometheusConfig` in Micrometer 1.13 (Spring Boot 3.3+), and also hard-requires the legacy `io.prometheus.client.exporter.*` classes that are no longer pulled in by `dubbo-observability-spring-boot-starter` in Dubbo 3.3.x. The net effect is that Prometheus reporter initialization is silently skipped for recent Spring Boot users, exactly matching the reproducer in the issue.
This change updates the check to accept either the legacy `io.micrometer.prometheus` package or the new `io.micrometer.prometheusmetrics` package, and drops the legacy `io.prometheus.client.*` requirements. Those are only needed in Pushgateway mode, and `PrometheusMetricsReporterFactory` already handles their absence via `NoClassDefFoundError`, so the extra `isClassPresent` hop here was just producing false negatives for scrape-only deployments.
Per @RainYuY's note on the issue that a compatible path is what's needed, this keeps the fix minimal and strictly scoped to the detection util so older Spring Boot 3.2.x / Micrometer < 1.13 users keep working.
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change. (Fixes #16109)
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test to verify your logic correction. `MetricsSupportUtilTest` covers the four classpath layouts (legacy only, new only, both, neither) by stubbing `ClassUtils` with `mockito-inline`, so detection is exercised regardless of which Micrometer Prometheus registry happens to be on the test runtime classpath.
- [x] Make sure gitHub actions can pass. Locally ran `mvn -pl dubbo-metrics/dubbo-metrics-api -am -Psources,skip-spotless,checkstyle clean install -Dmaven.test.skip=true`, `mvn -pl dubbo-metrics/dubbo-metrics-api -Pjacoco,skip-spotless test verify`, `mvn -pl dubbo-metrics/dubbo-metrics-prometheus -Pjacoco,skip-spotless test verify`, plus `mvn -pl dubbo-config/dubbo-config-api -Dtest=DefaultApplicationDeployerTest test` and `mvn spotless:check` on JDK 21 — all green.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Fix #16109: support Micrometer 1.13+ Prometheus package in MetricsSupportUtil [dubbo]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16205:
URL: https://github.com/apache/dubbo/pull/16205#issuecomment-4228318036
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/16205?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `1 line` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 29.72%. Comparing base ([`8814afa`](https://app.codecov.io/gh/apache/dubbo/commit/8814afac6b2106cfc0d4050ac8318df5774e560d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e1b89bd`](https://app.codecov.io/gh/apache/dubbo/commit/e1b89bd033f96520c250638bbea495a8e72e913f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/16205?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...apache/dubbo/metrics/utils/MetricsSupportUtil.java](https://app.codecov.io/gh/apache/dubbo/pull/16205?src=pr&el=tree&filepath=dubbo-metrics%2Fdubbo-metrics-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fmetrics%2Futils%2FMetricsSupportUtil.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tbWV0cmljcy9kdWJiby1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vbWV0cmljcy91dGlscy9NZXRyaWNzU3VwcG9ydFV0aWwuamF2YQ==) | 0.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (8814afa) and HEAD (e1b89bd). Click for more details.
>
> <details><summary>HEAD has 8 uploads less than BASE</summary>
>
>| Flag | BASE (8814afa) | HEAD (e1b89bd) |
>|------|------|------|
>|samples-tests-java21|1|0|
>|integration-tests-java8|1|0|
>|integration-tests-java21|1|0|
>|unit-tests-java8|1|0|
>|unit-tests-java25|1|0|
>|unit-tests-java11|1|0|
>|unit-tests-java21|1|0|
>|unit-tests-java17|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.3 #16205 +/- ##
=============================================
- Coverage 60.79% 29.72% -31.08%
+ Complexity 11751 9391 -2360
=============================================
Files 1953 1952 -1
Lines 89119 89094 -25
Branches 13444 13357 -87
=============================================
- Hits 54177 26479 -27698
- Misses 29368 58499 +29131
+ Partials 5574 4116 -1458
```
| [Flag](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.72% <0.00%> (-0.11%)` | :arrow_down: |
| [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java25](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/16205?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Fix #16109: support Micrometer 1.13+ Prometheus package in MetricsSupportUtil [dubbo]
Posted by "barry3406 (via GitHub)" <gi...@apache.org>.
barry3406 closed pull request #16205: Fix #16109: support Micrometer 1.13+ Prometheus package in MetricsSupportUtil
URL: https://github.com/apache/dubbo/pull/16205
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Fix #16109: support Micrometer 1.13+ Prometheus package in MetricsSupportUtil [dubbo]
Posted by "barry3406 (via GitHub)" <gi...@apache.org>.
barry3406 commented on PR #16205:
URL: https://github.com/apache/dubbo/pull/16205#issuecomment-4228330808
Closing this — sorry, I didn't notice that #16110, #16128, and #16132 (from the original reporter @SavitarC) were already open for the same issue. The minimal-fix approach is already covered by #16110, and shouldn't have added a fourth competing PR. The unit tests might be a useful follow-up to whichever of those ends up being merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org