Skip to content

Commit 844b1d1

Browse files
authored
Merge pull request #503 from RADAR-base/feature/sentry
Add support for Sentry monitoring
2 parents 06d9061 + 60cc3b3 commit 844b1d1

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,24 @@ Deploying the Spring Boot Admin server and the client as different components ma
571571
used to register multiple client apps and the server's lifecycle is not associated with the client. This also means that
572572
our client app is lighter and production ready.
573573

574+
### Sentry monitoring
575+
576+
To enable Sentry monitoring:
577+
578+
1. Add the `sentry` profile to active spring profiles.
579+
2. Set a `SENTRY_DSN` environment variable that points to the desired Sentry DSN.
580+
3. (Optional) Set the `SENTRY_LOG_LEVEL` environment variable to control the minimum log level of events sent to Sentry.
581+
The default log level for Sentry is `ERROR`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`.
582+
583+
For further configuration of Sentry via environmental variables see [here](https://docs.sentry.io/platforms/java/configuration/#configuration-via-the-runtime-environment). For instance:
584+
585+
```
586+
SENTRY_LOG_LEVEL: 'ERROR'
587+
SENTRY_DSN: 'https://000000000000.ingest.de.sentry.io/000000000000'
588+
SENTRY_ATTACHSTACKTRACE: true
589+
SENTRY_STACKTRACE_APP_PACKAGES: org.radarbase.appserver
590+
```
591+
574592
## Performance Testing
575593

576594
The app server supports performance testing using Gatling and Scala. The simulations are located in the

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ plugins {
22
id 'pmd'
33
id 'io.gatling.gradle' version '3.9.2.1'
44
id 'com.github.johnrengelman.shadow' version '8.1.0'
5-
id 'org.springframework.boot' version '3.2.10'
5+
id 'org.springframework.boot' version '3.2.11'
66
id 'org.openjfx.javafxplugin' version '0.0.13'
77
id("com.github.ben-manes.versions") version "0.46.0"
8+
id 'io.sentry.jvm.gradle' version '4.11.0'
89
}
910

1011
apply plugin: 'checkstyle'
@@ -32,7 +33,7 @@ bootJar {
3233
}
3334

3435
ext {
35-
springBootVersion = '3.2.10'
36+
springBootVersion = '3.2.11'
3637
springVersion = '6.0.6'
3738
springOauth2Version = "2.5.2.RELEASE"
3839
springOauth2AutoconfigureVersion = "2.6.8"

src/main/resources/logback-spring.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@
5959
</filter>
6060
</appender>
6161

62+
<appender name="Sentry" class="io.sentry.logback.SentryAppender">
63+
<minimumEventLevel>${SENTRY_LOG_LEVEL:-ERROR}</minimumEventLevel>
64+
</appender>
6265

6366
<!-- LOG everything at INFO level -->
6467
<root level="info">
6568
<appender-ref ref="RollingFile" />
6669
<appender-ref ref="Console" />
6770
<appender-ref ref="RollingFile-Error" />
71+
<springProfile name="sentry">
72+
<appender-ref ref="Sentry"/>
73+
</springProfile>
6874
</root>
6975

7076
</configuration>

0 commit comments

Comments
 (0)