I'm moving from EhCache 2 to EhCache3 ,a spring boot java application. For monitoring of Cache, I'm looking for Cache entries and heap size metric from EhCache 3. In EhCache2, I had these metrics via prometheus: (cache_size, cache_local_heap_size_bytes)
How can I get these with EhCache 3?
Here's my xml configuration:
<?xml version="1.0" encoding="UTF-8"?>
<config
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:jsr107='http://www.ehcache.org/v3/jsr107'
xmlns='http://www.ehcache.org/v3'
xsi:schemaLocation="
http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.1.xsd
http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.1.xsd">
<service>
<jsr107:defaults enable-management="false" enable-statistics="true"/>
</service>
<cache-template name="default">
<expiry>
<ttl>600</ttl>
</expiry>
</cache-template>
<cache alias="employee" uses-template="default">
<resources>
<heap>1000</heap>
</resources>
</cache>
<cache alias="org" uses-template="default">
<key-type>java.lang.String</key-type>
<resources>
<heap>4000</heap>
</resources>
</cache>
</config>
and then in application.yml I have:
cache:
jcache:
config: classpath:ehcache.xml