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

Update Sentry configuration #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,13 @@ To enable Sentry monitoring:

1. Set a `SENTRY_DSN` environment variable that points to the desired Sentry DSN.
2. (Optional) Set the `SENTRY_LOG_LEVEL` environment variable to control the minimum log level of events sent to Sentry.
The default log level for Sentry is `WARN`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`.
The default log level for Sentry is `ERROR`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`.

For further configuration of Sentry via environmental variables see [here](https://docs.sentry.io/platforms/java/configuration/#configuration-via-the-runtime-environment). For instance:

```
SENTRY_LOG_LEVEL: 'ERROR'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these variables automatically read by the library or should there defined somewhere else as well?

SENTRY_DSN: 'https://000000000000.ingest.de.sentry.io/000000000000'
SENTRY_ATTACHSTACKTRACE: true
SENTRY_STACKTRACE_APP_PACKAGES: org.radarbase
```
6 changes: 1 addition & 5 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,14 @@ object Versions {

const val kotlin = "1.9.10"

const val radarCommons = "1.1.2"
const val radarCommons = "1.1.3"
const val radarJersey = "0.11.1"
const val postgresql = "42.6.1"
const val ktor = "2.3.5"
const val jedis = "5.0.2"

const val slf4j = "2.0.9"
const val log4j2 = "2.21.0"

const val jersey = "3.1.3"
const val junit = "5.10.0"
const val mockitoKotlin = "5.1.0"
const val hamcrest = "2.2"
const val ktlint = "1.3.1"
}
9 changes: 6 additions & 3 deletions data-dashboard-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ plugins {
kotlin("plugin.noarg")
kotlin("plugin.jpa")
kotlin("plugin.allopen")
// TODO Remove this when new release of radar-commons is available and used in this project.
// This version has Sentry support built in for radar-kotlin plugin.
id("io.sentry.jvm.gradle") version "4.11.0"
id("org.radarbase.radar-kotlin") version Versions.radarCommons
}

application {
Expand Down Expand Up @@ -34,3 +32,8 @@ allOpen {
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
}

radarKotlin {
log4j2Version.set(Versions.log4j2)
sentryEnabled.set(true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to have this on by default?

}
4 changes: 2 additions & 2 deletions data-dashboard-backend/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<loggers>
<root level="INFO">
<appender-ref ref="Console" />
<!-- Note that the Sentry logging threshold is at WARN level by default -->
<appender-ref ref="Sentry" level="${env:SENTRY_LOG_LEVEL:-WARN}" />
<!-- Note that the Sentry logging threshold is at ERROR level by default -->
<appender-ref ref="Sentry" level="${env:SENTRY_LOG_LEVEL:-ERROR}" />
</root>
</loggers>
</configuration>
Loading