Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tech - Ajout de l'environnement dans sentry (UPDATE ENV VAR) #4014

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ 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<String>) {
val ctx = runApplication<MonitorFishApplication>(*args)
val logger: Logger = LoggerFactory.getLogger(MonitorFishApplication::class.java)

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
}
Expand Down
2 changes: 2 additions & 0 deletions infra/remote/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading