[ 
https://issues.apache.org/jira/browse/GEODE-10045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503205#comment-17503205
 ] 

John Blum commented on GEODE-10045:
-----------------------------------

Upgrading this ticket to a "*Blocker*" now that core Spring APIs and components 
are relying on the core Micrometer libraries and APIs to implement 
_Observability_ across the Spring portfolio.

For instance, Spring Boot is integrating essential Micrometer functionality to 
implement key metrics (e.g. Startup Time) provided by Spring Boot Actuator.  As 
a result, Spring Boot for Apache Geode will no longer build/run with Micrometer 
1.x (i.e. Micrometer 1.6.3 on which Apache Geode 1.14.3 is currently 
[based|https://github.com/apache/geode/blob/rel/v1.14.3/boms/geode-all-bom/src/test/resources/expected-pom.xml#L226-L231]),
 which causes the following Exception to be thrown:

{code:java}
java.lang.NoSuchMethodError: 'io.micrometer.core.instrument.TimeGauge$Builder 
io.micrometer.core.instrument.TimeGauge.builder(java.lang.String, 
java.util.function.Supplier, java.util.concurrent.TimeUnit)'
        at 
org.springframework.boot.actuate.metrics.startup.StartupTimeMetricsListener.registerGauge(StartupTimeMetricsListener.java:119)
        at 
org.springframework.boot.actuate.metrics.startup.StartupTimeMetricsListener.onApplicationStarted(StartupTimeMetricsListener.java:106)
        at 
org.springframework.boot.actuate.metrics.startup.StartupTimeMetricsListener.onApplicationEvent(StartupTimeMetricsListener.java:98)
...
{code}

Conversely, Apache Geode will not build/run with the new Spring Boot, 
Micrometer 2.0 
[baseline|https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-dependencies/build.gradle#L954-L965],
 leading to the following Exception, which is thrown from Apache Geode:

{code:java}
...
Caused by: java.lang.NoClassDefFoundError: 
io/micrometer/core/instrument/binder/system/FileDescriptorMetrics
        at 
org.apache.geode.metrics.internal.StandardMeterBinder.<init>(StandardMeterBinder.java:40)
        at 
org.apache.geode.metrics.internal.InternalDistributedSystemMetricsService$Builder.build(InternalDistributedSystemMetricsService.java:250)
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:804)
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.access$200(InternalDistributedSystem.java:132)
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem$Builder.build(InternalDistributedSystem.java:3011)
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:282)
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:208)
        at 
org.apache.geode.cache.client.ClientCacheFactory.connectInternalDistributedSystem(ClientCacheFactory.java:282)
        at 
org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:252)
        at 
org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:218)
        at 
org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:411)
        at 
org.springframework.data.gemfire.AbstractResolvableCacheFactoryBean.resolveCache(AbstractResolvableCacheFactoryBean.java:153)
        at 
org.springframework.data.gemfire.AbstractResolvableCacheFactoryBean.init(AbstractResolvableCacheFactoryBean.java:72)
        at 
org.springframework.data.gemfire.AbstractResolvableCacheFactoryBean.doGetObject(AbstractResolvableCacheFactoryBean.java:52)
        at 
org.springframework.data.gemfire.AbstractBasicCacheFactoryBean.getObject(AbstractBasicCacheFactoryBean.java:351)
        at 
org.springframework.data.gemfire.AbstractBasicCacheFactoryBean.getObject(AbstractBasicCacheFactoryBean.java:113)
        at 
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:148)
        ... 84 more
Caused by: java.lang.ClassNotFoundException: 
io.micrometer.core.instrument.binder.system.FileDescriptorMetrics
        at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 101 more
{code}

This leaves Spring and Apache Geode at an impasse as of SBDG 2.0 / Spring Boot 
3.0.

This problem is only going to grow as more and more core Spring functionality 
is augmented with metrics using Micrometer 2.0.

Spring Data (Commons) is also using Micrometer in the core Repository 
infrastructure to gather runtime metrics.

This Micrometer incompatibility will effectively render Apache Geode inoperable 
on Spring 6 / Spring Boot/Data 3 and so on.


> Upgrade to Micrometer 2.0
> -------------------------
>
>                 Key: GEODE-10045
>                 URL: https://issues.apache.org/jira/browse/GEODE-10045
>             Project: Geode
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.14.3
>            Reporter: John Blum
>            Priority: Blocker
>              Labels: Micrometer
>
> As part of the ongoing story and themes in Spring Framework 6, Spring Data 
> 3.0 and the rest of the Spring portfolio, 1 of the new and major topics is 
> Observability (Monitoring with Metrics, Tracing, and so on).
> As part of that effort, Micrometer is undergoing a major revision change from 
> 1.x to 2.0.  Many of their APIs have changed, and as a result, Apache Geode 
> no longer runs (or even will build) with Micrometer 2.0.
> Either Micrometer should be upgraded to 2.0 (most likely in the next major 
> version of Geode, i.e. 2.0) or Micrometer should be an optional dependency, 
> perhaps only enabled when Micrometer is on the classpath.
> Still a cleaner separation is needed if [Spring] Apache Geode users require 
> and use a newer version of Micrometer (e.g. 2.0) and Apache Geode remains on 
> Micrometer 1.x (currently 
> [1.6.3|https://github.com/apache/geode/blob/rel/v1.14.3/boms/geode-all-bom/src/test/resources/expected-pom.xml#L226-L231]
>  in Apache Geode {{1.14.3}}).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to