Skip to content

Commit

Permalink
Use Sentry Spring starter
Browse files Browse the repository at this point in the history
  • Loading branch information
schnapster committed Dec 10, 2023
1 parent f78f42f commit a8271d4
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 126 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ project(':platform') {
dependencies {
api platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
api platform("io.prometheus:simpleclient_bom:$prometheusVersion")
api platform("io.sentry:sentry-bom:$sentryVersion")
constraints {
api "net.dv8tion:JDA:$jdaVersion"
api "club.minnced:discord-webhooks:$discordWebhooksVersion"
api "io.sentry:sentry-logback:$sentryLogbackVersion"
api "org.json:json:$orgJsonVersion"
api "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
api "org.glassfish.jaxb:jaxb-core:$jaxbImplVersion"
Expand Down Expand Up @@ -457,6 +457,8 @@ dependencies {

implementation "ch.qos.logback:logback-classic"
implementation "io.sentry:sentry-logback"
implementation "io.sentry:sentry-spring-boot-starter-jakarta"
implementation "io.sentry:sentry-kotlin-extensions"

implementation "org.yaml:snakeyaml"
implementation "com.squareup.okhttp3:okhttp"
Expand Down
5 changes: 5 additions & 0 deletions gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ io.prometheus:simpleclient_tracer_common:0.16.0=compileClasspath,implementationD
io.prometheus:simpleclient_tracer_otel:0.16.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.prometheus:simpleclient_tracer_otel_agent:0.16.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.r2dbc:r2dbc-spi:1.0.0.RELEASE=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry-bom:7.0.0=annotationProcessor,apiDependenciesMetadata,compileClasspath,compileOnlyDependenciesMetadata,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry-kotlin-extensions:7.0.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry-logback:7.0.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry-spring-boot-jakarta:7.0.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry-spring-boot-starter-jakarta:7.0.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry-spring-jakarta:7.0.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.sentry:sentry:7.0.0=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.smallrye:jandex:3.1.2=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
io.undertow:undertow-core:2.3.10.Final=compileClasspath,implementationDependenciesMetadata,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ theYarnVersion=1.22.19

jdaVersion=[5.0.0-beta.9, 5.1[
discordWebhooksVersion=[0.8.2, 1.0[
sentryLogbackVersion=[7.0.0, 8.0[
sentryVersion=[7.0.0, 8.0[
orgJsonVersion=20231013
jaxbImplVersion=[4.0.2, 5.0[
nashornVersion=[15.4, 18[
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/space/npstr/wolfia/EagerLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.springframework.stereotype.Component;
import space.npstr.prometheus_extensions.jda.JdaMetrics;
import space.npstr.wolfia.commands.CommandHandler;
import space.npstr.wolfia.config.SentryConfiguration;
import space.npstr.wolfia.domain.oauth2.OAuth2Refresher;
import space.npstr.wolfia.domain.setup.lastactive.AutoOuter;
import space.npstr.wolfia.game.GameResources;
Expand All @@ -33,19 +32,16 @@
public class EagerLoader {

private final ShutdownHandler shutdownHandler;
private final SentryConfiguration sentryConfiguration;
private final JdaMetrics jdaMetrics;
private final OAuth2Refresher oAuth2Refresher;
private final AutoOuter autoOuter;
private final GameResources gameResources;
private final CommandHandler commandHandler;

public EagerLoader(ShutdownHandler shutdownHandler, SentryConfiguration sentryConfiguration, JdaMetrics jdaMetrics,
OAuth2Refresher oAuth2Refresher, AutoOuter autoOuter, GameResources gameResources,
CommandHandler commandHandler) {
public EagerLoader(ShutdownHandler shutdownHandler, JdaMetrics jdaMetrics, OAuth2Refresher oAuth2Refresher,
AutoOuter autoOuter, GameResources gameResources, CommandHandler commandHandler) {

this.shutdownHandler = shutdownHandler;
this.sentryConfiguration = sentryConfiguration;
this.jdaMetrics = jdaMetrics;
this.oAuth2Refresher = oAuth2Refresher;
this.autoOuter = autoOuter;
Expand Down
80 changes: 0 additions & 80 deletions src/main/java/space/npstr/wolfia/config/SentryConfiguration.java

This file was deleted.

This file was deleted.

9 changes: 9 additions & 0 deletions src/main/resources/wolfia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,12 @@ logging:
root: INFO
space.npstr: DEBUG
org.springframework.web.filter.CommonsRequestLoggingFilter: DEBUG

sentry:
dsn: ""
logging.enabled: false
in-app-includes:
- "space.npstr"
- "dev.capybaralabs"
logging:
minimum-event-level: warn
2 changes: 0 additions & 2 deletions src/test/java/space/npstr/wolfia/LauncherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import space.npstr.prometheus_extensions.jda.JdaMetrics;
import space.npstr.wolfia.commands.CommRegistry;
import space.npstr.wolfia.commands.CommandHandler;
import space.npstr.wolfia.config.SentryConfiguration;
import space.npstr.wolfia.db.Database;
import space.npstr.wolfia.domain.oauth2.OAuth2Refresher;
import space.npstr.wolfia.domain.setup.lastactive.AutoOuter;
Expand Down Expand Up @@ -60,7 +59,6 @@ void applicationContextLoads() {
assertThatContainsBean("gameResources", GameResources.class);
assertThatContainsBean("database", Database.class);
assertThatContainsBean("shutdownHandler", ShutdownHandler.class);
assertThatContainsBean("sentryConfiguration", SentryConfiguration.class);
assertThatContainsBean("jdaMetrics", JdaMetrics.class);
assertThatContainsBean("OAuth2Refresher", OAuth2Refresher.class);
assertThatContainsBean("autoOuter", AutoOuter.class);
Expand Down

0 comments on commit a8271d4

Please sign in to comment.