Skip to content

Commit e6e130a

Browse files
vskjefstJMLindseth
andcommitted
Sett initial delay på liveness- og readiness-probes
Appen starter ikke opp i dev, vi håper at det er på grunn av en K8S probe som ikke får svar, og sender shutdown Co-authored-by: John Martin Lindseth <[email protected]>
1 parent d50f8e5 commit e6e130a

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dp-inntekt-api/src/main/kotlin/no/nav/dagpenger/inntekt/Application.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fun main() {
5353
}.also {
5454
Runtime.getRuntime().addShutdownHook(
5555
Thread {
56+
println("Kafka shutdown hook called")
5657
it.stop()
5758
},
5859
)
@@ -75,6 +76,7 @@ fun main() {
7576
}.start().also {
7677
Runtime.getRuntime().addShutdownHook(
7778
Thread {
79+
println("Netty shutdown hook called")
7880
it.stop(5, 60, TimeUnit.SECONDS)
7981
},
8082
)

dp-inntekt-api/src/main/kotlin/no/nav/dagpenger/inntekt/NaisChecks.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fun Routing.naischecks(
1515
meterRegistry: PrometheusMeterRegistry,
1616
) {
1717
get("/isAlive") {
18+
LOGGER.info("/isAlive")
1819
val failingHealthChecks = healthChecks.filter { it.status() == HealthStatus.DOWN }
1920

2021
when {
@@ -26,10 +27,14 @@ fun Routing.naischecks(
2627
}
2728
}
2829
get("/isReady") {
30+
LOGGER.info("/isReady")
2931
call.respondText("READY", ContentType.Text.Plain)
3032
}
3133
get("/metrics") {
32-
val names = call.request.queryParameters.getAll("name[]")?.toSet() ?: setOf()
34+
val names =
35+
call.request.queryParameters
36+
.getAll("name[]")
37+
?.toSet() ?: setOf()
3338
call.respondText(meterRegistry.scrape(), ContentType.parse("text/plain; version=0.0.4; charset=utf-8"))
3439
}
3540
}

nais/dev/nais.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ spec:
1818
webproxy: true
1919
liveness:
2020
path: /isAlive
21-
initialDelay: 10
2221
readiness:
2322
path: /isReady
24-
initialDelay: 10
23+
initialDelay: 30
2524
prometheus:
2625
enabled: true
2726
path: /metrics

0 commit comments

Comments
 (0)