Skip to content

Commit

Permalink
RISDEV-6933 Add sentry for staging
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-deazevedo committed Feb 28, 2025
1 parent cf5c990 commit 08b519f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ val protobufVersion = "4.29.3"
val joseVersion = "0.9.6"
val okioVersion = "3.10.2"
val springdocVersion = "2.8.5"
val sentryVersion = "8.3.0"
dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
Expand All @@ -58,6 +59,8 @@ dependencies {
implementation("org.flywaydb:flyway-database-postgresql")
implementation("org.springframework.session:spring-session-core")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$springdocVersion")
implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion")
implementation("io.sentry:sentry-logback:$sentryVersion")
compileOnly("org.projectlombok:lombok")
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
runtimeOnly("org.postgresql:postgresql")
Expand Down
11 changes: 10 additions & 1 deletion backend/src/main/resources/application-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ management:
endpoint:
health:
probes:
enabled: true
enabled: true

sentry:
dsn: ${SENTRY_DSN}
environment: staging
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
send-default-pii: true
# Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing.
tracesSampleRate: 0.01
13 changes: 13 additions & 0 deletions backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProfile name="!(staging | production | uat)">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
</springProfile>
<springProfile name="staging,production,uat">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<appender name="SENTRY" class="io.sentry.logback.SentryAppender" />
<root level="INFO">
<appender-ref ref="SENTRY"/>
</root>
</springProfile>
</configuration>

0 comments on commit 08b519f

Please sign in to comment.