Is there a support for HikariCP's setHealthCheckRe...
# ktor
m
Is there a support for HikariCP's setHealthCheckRegistry? I'm trying this:
Copy code
Jdbi.create(HikariDataSource(HikariConfig().apply {
			username = config.property("db.username").getString()
			password = config.property("db.password").getString()
			jdbcUrl = config.property("db.jdbcUrl").getString()

			application.featureOrNull(DropwizardMetrics)?.registry?.also {
				<http://application.log.info|application.log.info>("Dropwizard metrics feature detected. Registering HikariCP metrics.")
				metricRegistry = it
				healthCheckRegistry = it
			}
		}
but getting an error:
java.lang.NoClassDefFoundError: com/codahale/metrics/health/HealthCheckRegistry
at com.zaxxer.hikari.HikariConfig.setHealthCheckRegistry(HikariConfig.java:697)
c
Looks like you are missing some dependency. Not related to ktor at all
m
Can you point me in the right direction? how do I register health checks?
Nvm you were right. I added
Copy code
<dependency>
    <groupId>io.dropwizard.metrics</groupId>
    <artifactId>metrics-healthchecks</artifactId>
    <version>${dropwizard-metrics.version}</version>
</dependency>
and instantiated a
HealthCheckRegistry
. It seems Ktor does not provide a default
HealthCheckRegistry
only Metrics.
c
Right, just already started to type this dependency name 🙂
Just keep versions compatible
m
Thanks.