diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/MonitorFishApplication.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/MonitorFishApplication.kt index 65f673bd19..03fdf9e7b3 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/MonitorFishApplication.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/MonitorFishApplication.kt @@ -6,8 +6,7 @@ import org.slf4j.LoggerFactory import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication -@SpringBootApplication -class MonitorFishApplication +@SpringBootApplication class MonitorFishApplication fun main(args: Array) { val ctx = runApplication(*args) @@ -15,11 +14,16 @@ fun main(args: Array) { val isSentryEnabled: String? = ctx.environment.getProperty("monitorfish.sentry.enabled") val sentryDsn: String? = ctx.environment.getProperty("sentry.dsn") + val sentryEnvironment: String? = ctx.environment.getProperty("monitorfish.sentry.env") + val version: String? = ctx.environment.getProperty("monitorfish.version") if (isSentryEnabled == "true") { Sentry.init { options -> options.dsn = sentryDsn - // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. + options.environment = sentryEnvironment + options.release = version + // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance + // monitoring. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0 } diff --git a/infra/remote/docker-compose.yml b/infra/remote/docker-compose.yml index 1130facef1..e2d29fe9f7 100644 --- a/infra/remote/docker-compose.yml +++ b/infra/remote/docker-compose.yml @@ -26,6 +26,7 @@ services: - MONITORFISH_HTTP_PROXY_HOST=$MONITORFISH_HTTP_PROXY_HOST - MONITORFISH_HTTP_PROXY_PORT=$MONITORFISH_HTTP_PROXY_PORT - MONITORFISH_HTTP_NON_PROXY_HOSTS=$MONITORFISH_HTTP_NON_PROXY_HOSTS + - MONITORFISH_VERSION=$MONITORFISH_VERSION - ENV_DB_URL=jdbc:postgresql://db:5432/$POSTGRES_DB?user=$POSTGRES_USER&password=$POSTGRES_PASSWORD - FRONTEND_GEOSERVER_REMOTE_URL=$MONITORFISH_GEOSERVER_REMOTE_URL - FRONTEND_GEOSERVER_LOCAL_URL=$MONITORFISH_GEOSERVER_LOCAL_URL @@ -44,6 +45,7 @@ services: - MONITORFISH_API_PROTECTED_PATHS=$MONITORFISH_API_PROTECTED_PATHS - MONITORFISH_API_PROTECTED_PUBLIC_PATHS=$MONITORFISH_API_PROTECTED_PUBLIC_PATHS - MONITORFISH_SCHEDULING_ENABLED=$MONITORFISH_SCHEDULING_ENABLED + - MONITORFISH_SENTRY_ENV=$MONITORFISH_SENTRY_ENV - FRONTEND_SENTRY_ENV=$MONITORFISH_SENTRY_ENV - SENTRY_DSN=$MONITORFISH_SENTRY_DSN - FRONTEND_SENTRY_DSN=$MONITORFISH_SENTRY_DSN