javaquarkusmicrometerquarkus-hibernate-orm

Quarkus HibernateORM metrics not working when set through environment variables


In a Java application running on Quarkus v3.4.1 with the MicroMeter extension enabled and functioning I am having trouble enabling the HibernateORM metrics which through the environment variable QUARKUS_HIBERNATE_ORM_METRICS_ENABLED as per the Quarkus docs when running the application in a container. The environment variable is present in the container.

When running the application with the quarkus.hibernate-orm.metrics.enabled=true directly set in the application.properties the hibernate_* metrics are present in the metrics endpoint response.

quarkus.hibernate-orm.enabled is also not explicitly set anywhere, so it should evaluate to true by default. I was thinking that the metrics_enabled setting might be a build-time option, but the documentation does not imply that.

Running the application directly on the host machine via Maven in an environment with the variable already present seems to work as well. Seems this behaviour is reproducible only when the application is running in a container.


Solution

  • quarkus.hibernate-orm.metrics.enabled is indeed a build time option. You can tell that by the lock icon and if you hover over it, it shows you the label. It cannot be changed at runtime.

    enter image description here