-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minske error-logging når noe faktisk ikke er error (#6017)
* Kaster forespoerselexception med 503-kode Hvis vi ikke er klar enda kaster vi i stedet en forespoerselexception som gir en 503 feilkode. Da ser vi det ikke i loggene, siden det ikke er en ERROR at appen ikke har satt ready enda * Fjerner shutdownlogging for sikkerlogg Mistenker at dette er årsaken for "Uncaught error in thread main: IllegalStateException". Vi trenger den uansett ikke -- vi kan filtrere på oppstart + pod for å se at den logger til sikkerlogg riktig * Fjerner potensiale for error-alerts hvis vi ikke får logget v/ shutdown
- Loading branch information
Showing
20 changed files
with
48 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package no.nav.etterlatte | ||
|
||
import no.nav.etterlatte.libs.common.logging.sikkerLoggOppstartOgAvslutning | ||
import no.nav.etterlatte.libs.common.logging.sikkerLoggOppstart | ||
import no.nav.etterlatte.statistikk.config.ApplicationContext | ||
|
||
fun main() = | ||
with(ApplicationContext()) { | ||
maanedligStatistikkJob.schedule().also { addShutdownHook(it) } | ||
initRapidsConnection() | ||
sikkerLoggOppstartOgAvslutning("etterlatte-statistikk") | ||
sikkerLoggOppstart("etterlatte-statistikk") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
libs/etterlatte-ktor/src/main/kotlin/initialisering/ReadinessProbe.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
package no.nav.etterlatte.libs.ktor | ||
package no.nav.etterlatte.libs.ktor.initialisering | ||
|
||
import io.ktor.http.HttpStatusCode | ||
import no.nav.etterlatte.libs.common.feilhaandtering.ForespoerselException | ||
import java.util.concurrent.atomic.AtomicBoolean | ||
|
||
private var ready = AtomicBoolean(false) | ||
|
||
fun setReady(value: Boolean = true) = ready.set(value) | ||
|
||
fun isReady() = if (ready.get()) HttpStatusCode.OK else HttpStatusCode.ServiceUnavailable | ||
fun isReady() = | ||
if (ready.get()) { | ||
HttpStatusCode.OK | ||
} else { | ||
throw ForespoerselException( | ||
status = HttpStatusCode.ServiceUnavailable.value, | ||
"SERVICE_UNAVAILABLE", | ||
"Service not yet ready", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters