Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-15351

Check if MetricsRegistry is enabled before trying to register metrics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 14.0.22.Final, 15.0.0.Final
    • None
    • None
    • None
    • Hide

      At the cache container level, disable metrics

      <cache-container>
        <metrics gauges="false" histograms="false"/>
      </cache-container>
      

      Another alternative is to register an implementation of io.micrometer.core.instrument.MeterRegistry

      Show
      At the cache container level, disable metrics <cache-container> <metrics gauges= "false" histograms= "false" /> </cache-container> Another alternative is to register an implementation of io.micrometer.core.instrument.MeterRegistry

      WARN: ISPN000202: Encountered issues while backing up data for cache replicatedXSiteCache to site site02
      java.lang.NullPointerException
      	at java.base/java.util.Objects.requireNonNull(Objects.java:209)
      	at org.infinispan.remoting.transport.jgroups.JGroupsMetricsManagerImpl$DestinationMetricsBuilder.build(JGroupsMetricsManagerImpl.java:253)
      	at org.infinispan.remoting.transport.jgroups.JGroupsMetricsManagerImpl.createDestinationMetrics(JGroupsMetricsManagerImpl.java:185)
      	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
      	at org.infinispan.remoting.transport.jgroups.JGroupsMetricsManagerImpl.get(JGroupsMetricsManagerImpl.java:168)
      	at org.infinispan.remoting.transport.jgroups.JGroupsMetricsManagerImpl.recordMessageSent(JGroupsMetricsManagerImpl.java:120)
      	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.sendCommand(JGroupsTransport.java:1200)
      	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.backupRemotely(JGroupsTransport.java:380)
      	at org.infinispan.remoting.rpc.RpcManagerImpl.invokeXSite(RpcManagerImpl.java:433)
      
      

      The NullPointerException is caused by MetricsRegistry not being enabled because not MeterRegistry is in the classpath. We should not try to create metrics for sent messages if that is the case.

      Also, the second issue, the JGroupsMetricsManager should only be tracking local cluster messages and not cross-site ones.

              pruivo@redhat.com Pedro Ruivo
              pruivo@redhat.com Pedro Ruivo
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: