net.nemerosa.ontrack.extension.influxdb.InfluxDBExtensionHealthIndicator.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-extension-influxdb Show documentation
Show all versions of ontrack-extension-influxdb Show documentation
Ontrack module: ontrack-extension-influxdb
package net.nemerosa.ontrack.extension.influxdb
import org.springframework.boot.actuate.health.Health
import org.springframework.boot.actuate.health.HealthIndicator
class InfluxDBExtensionHealthIndicator(
private val influxDBConnection: InfluxDBConnection
) : HealthIndicator {
override fun health(): Health {
val ok: Boolean = try {
influxDBConnection.isValid
} catch (ex: Exception) {
false
}
return if (ok) {
Health.up().build()
} else {
Health.down().build()
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy