utafrali opened a new pull request, #16128:
URL: https://github.com/apache/dubbo/pull/16128

   Fixes #16109
   
   Ran into this while setting up Dubbo 3.3.6 with Spring Boot 3.5 and 
`dubbo-observability-spring-boot-starter`. Prometheus metrics were silently not 
initializing because `MetricsSupportUtil.isSupportPrometheus()` was checking 
for class names that no longer exist in Micrometer 1.13+ 
(`io.micrometer.prometheus.PrometheusConfig`) and requiring PushGateway 
exporter classes that aren't always on the classpath.
   
   The detection now accepts both the old `io.micrometer.prometheus` and the 
new `io.micrometer.prometheusmetrics` package. PushGateway classes are no 
longer required for the check since most setups just use the scrape endpoint.
   
   Also wrapped PushGateway initialization in `PrometheusMetricsReporter` with 
a `NoClassDefFoundError` catch so the reporter still works for scrape mode when 
pushgateway deps are missing. Broadened the error handling in 
`PrometheusMetricsReporterFactory.dependenciesNotFound()` to properly catch any 
micrometer or prometheus class loading failures.
   
   Tests:
   
   ```
   mvn -pl dubbo-metrics/dubbo-metrics-api -Dtest=MetricsSupportUtilTest test
   mvn -pl dubbo-metrics/dubbo-metrics-prometheus 
-Dtest=PrometheusMetricsReporterTest,PrometheusMetricsReporterFactoryTest test
   mvn -pl dubbo-config/dubbo-config-api -am 
-Dtest=DefaultApplicationDeployerTest test
   ```
   
   All passing locally on JDK 21.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to