JDBC Pool Metrics Not Updating

Problem:
The metrics for the JDBC pool are not showing correct values on the /metrics endpoints. Metrics like:

  • connection_pool_poolName_usedConnection_total,
  • connection_pool_poolName_totalConnection
  • connection_pool_poolName_freeConnection_total

always display 0.0, even though we know that database connections are being opened, used, and returned to the pool.

Version:
Docker image with payara/micro:6.2024.7-jdk21

Configurations:

  • steady-pool-size=3
  • get server-config.microprofile-metrics-configuration.*
    enabled=true
    dynamic=true
    endpoint=metrics
    roles=microprofile,admin
    secure-metrics=false
  • set server-config.monitoring-service.module-monitoring-levels.jdbc-connection-pool=HIGH
  • set server-config.monitoring-service.mbean-enabled=true

According to the logs, the Java application uses connections from the JDBC connection pool correctly. However, I have no idea why it doesn’t show up on the /metrics page.
All the other values seem to be correct.

Thank you.