|
|
@ -33,17 +33,12 @@ class MyHealthMetricsExportConfiguration(registry: MeterRegistry, healthEndpoint
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun getStatusCode(health: HealthEndpoint): Int {
|
|
|
|
private fun getStatusCode(health: HealthEndpoint): Int {
|
|
|
|
val status = health.health().status
|
|
|
|
return when (health.health().status) {
|
|
|
|
if (Status.UP == status) {
|
|
|
|
Status.UP -> 3
|
|
|
|
return 3
|
|
|
|
Status.OUT_OF_SERVICE -> 2
|
|
|
|
}
|
|
|
|
Status.DOWN -> 1
|
|
|
|
if (Status.OUT_OF_SERVICE == status) {
|
|
|
|
else -> 0
|
|
|
|
return 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Status.DOWN == status) {
|
|
|
|
|
|
|
|
return 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|