Skip to content
This repository has been archived by the owner on Feb 19, 2025. It is now read-only.

Commit

Permalink
fix: health check + sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfallet committed Feb 21, 2024
1 parent 221217e commit a7a7c6e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions helm/suitebde/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ livenessProbe:
periodSeconds: 30
failureThreshold: 10
httpGet:
path: /
path: /healthz
port: http
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 30
failureThreshold: 2
httpGet:
path: /
path: /readyz
port: http

autoscaling:
Expand Down
3 changes: 2 additions & 1 deletion suitebde-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ kotlin {
val ktorVersion = "2.3.7"
val koinVersion = "3.5.0"
val logbackVersion = "0.9.30"
val ktorxVersion = "2.2.0"
val ktorxVersion = "2.2.1"

sourceSets {
val commonMain by getting {
Expand Down Expand Up @@ -72,6 +72,7 @@ kotlin {
implementation("me.nathanfallet.i18n:i18n:1.0.10")
implementation("me.nathanfallet.surexposed:surexposed:1.0.1")
implementation("me.nathanfallet.ktorx:ktor-database-sessions:$ktorxVersion")
implementation("me.nathanfallet.ktorx:ktor-health:$ktorxVersion")
implementation("me.nathanfallet.ktorx:ktor-i18n:$ktorxVersion")
implementation("me.nathanfallet.ktorx:ktor-i18n-freemarker:$ktorxVersion")
implementation("me.nathanfallet.ktorx:ktor-routers:$ktorxVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package me.nathanfallet.suitebde.plugins
import io.ktor.server.application.*
import io.ktor.server.plugins.callloging.*
import io.ktor.server.request.*
import io.sentry.Sentry
import me.nathanfallet.ktorx.plugins.KtorHealth
import me.nathanfallet.ktorx.plugins.KtorSentry
import org.slf4j.event.Level

Expand All @@ -12,18 +12,18 @@ fun Application.configureMonitoring() {
level = Level.INFO
filter { call -> call.request.path().startsWith("/") }
}
install(KtorHealth)

val env = environment.config.property("ktor.environment").getString().takeIf {
it != "localhost" && it != "test"
} ?: return
Sentry.init {
it.dsn = "https://924adee08965753ab548bec9d57b3700@o4506105040470016.ingest.sentry.io/4506106976862208"
it.environment = env
it.tracesSampleRate = when (env) {
install(KtorSentry) {
dsn = "https://924adee08965753ab548bec9d57b3700@o4506105040470016.ingest.sentry.io/4506106976862208"
environment = env
tracesSampleRate = when (env) {
"production" -> 0.1
"dev" -> 1.0
else -> 0.0
}
}
install(KtorSentry)
}
2 changes: 1 addition & 1 deletion suitebde-commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kotlin {

applyDefaultHierarchyTemplate()

val ktorxVersion = "2.2.0"
val ktorxVersion = "2.2.1"
val usecasesVersion = "1.5.6"

sourceSets {
Expand Down

0 comments on commit a7a7c6e

Please sign in to comment.