Search code examples
wildflymetricsinfinispanmicroprofilesmallrye

How to enable Infinispan smallrye metrics in Wildfly 20?


We want to expose the metrics of our Hibernate caches into Prometheus, and have for the time being built our own metrics for the caches, but since Infinispan 10 provides native metrics support, we'd rather use that.

So when I curl the localhost:9990/metrics and look for infinispan related metrics, I find nothing. I do find jgroups, and our own metrics.

The configuration for the metrics in the standalone.xml is:

<subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" 
    security-enabled="false" 
    exposed-subsystems="*" 
    prefix="${wildfly.metrics.prefix:wildfly}"
/>

We've also added "statistics-enabled=true" to the defined infinispan cache-containers:

<cache-container name="hibernate" 
    default-cache="local-query" 
    module="org.infinispan.hibernate-cache" 
    statistics-enabled="true">

I've searched the web for Infinispan, Wildfly, metrics, but I only find generic metrics articles about how you can create your own, or the announcements of added support for metrics in Infinispan.

According to the subsystem configuration all metrics should be exposed. Is there anything that we need to configure in addition to enable infinispan metrics inside wildfly?


Solution

  • I had the same issue and found out that there is a bug in Wildfly 20, so that infinispan statistics aren't exported. See WFLY-14063 and the fixing pull-request.

    The fix version mentioned in the ticket is 22.0.0.Beta1.