datastax / cassandra-quarkus

An Apache Cassandra(R) extension for Quarkus
Apache License 2.0
39 stars 28 forks source link

Cannot disable metrics in native mode #157

Closed adutra closed 3 years ago

adutra commented 3 years ago

Steps to reproduce:

Expected outcome: the tests pass.

Observed outcome:

ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.IllegalArgumentException: Can't find class DropwizardMetricsFactory (specified by advanced.metrics.factory.class)
    at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:219)
    at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:108)
    at com.datastax.oss.driver.internal.core.context.DefaultDriverContext.buildMetricsFactory(DefaultDriverContext.java:605)

This is due to DropwizardMetricsFactory not being registered for reflection, but it should be since that's the driver's default implementation of MetricsFactory, and it also serves as the de facto no-op implementation when metrics are disabled.

┆Issue is synchronized with this Jira Task by Unito

adutra commented 3 years ago

This will likely require some changes in the driver too: JAVA-2927.