1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 10:19:35 +01:00

feat: Sentry-kompatibles Error-Tracking (Bugsink) für Frontend und Backend

Frontend: @sentry/node mit instrument.ts, globale Error-Handler, 5xx-Interceptor.
Backend: sentry-spring-boot-starter-jakarta, Sentry.captureException im GlobalExceptionHandler.
Konfiguration über SENTRY_DSN Env-Variable, Bugsink via make bugsink startbar.
This commit is contained in:
Sebastian Frick 2026-02-23 22:40:19 +01:00
parent 5fe0dfc139
commit df1d1dfdd3
9 changed files with 818 additions and 6 deletions

View file

@ -88,6 +88,13 @@
<artifactId>liquibase-core</artifactId>
</dependency>
<!-- Sentry / Bugsink Error Tracking -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring-boot-starter-jakarta</artifactId>
<version>8.28.0</version>
</dependency>
<!-- OpenAPI/Swagger Documentation -->
<dependency>
<groupId>org.springdoc</groupId>

View file

@ -26,6 +26,7 @@ import de.effigenix.infrastructure.usermanagement.web.controller.RoleController;
import de.effigenix.infrastructure.usermanagement.web.controller.UserController;
import de.effigenix.infrastructure.usermanagement.web.dto.ErrorResponse;
import io.sentry.Sentry;
import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -280,6 +281,7 @@ public class GlobalExceptionHandler {
) {
RepositoryError error = ex.getError();
logger.error("Role repository error: {}", error.message());
Sentry.captureException(ex);
ErrorResponse errorResponse = ErrorResponse.from(
"REPOSITORY_ERROR",
@ -440,6 +442,7 @@ public class GlobalExceptionHandler {
HttpServletRequest request
) {
logger.error("Unexpected runtime error: {}", ex.getMessage(), ex);
Sentry.captureException(ex);
ErrorResponse errorResponse = ErrorResponse.from(
"INTERNAL_ERROR",
@ -459,6 +462,7 @@ public class GlobalExceptionHandler {
HttpServletRequest request
) {
logger.error("Unexpected checked exception: {}", ex.getMessage(), ex);
Sentry.captureException(ex);
ErrorResponse errorResponse = ErrorResponse.from(
"INTERNAL_ERROR",

View file

@ -32,6 +32,12 @@ jwt:
expiration: 28800000 # 8 hours in milliseconds
refresh-expiration: 604800000 # 7 days in milliseconds
# Sentry / Bugsink Error Tracking
sentry:
dsn: ${SENTRY_DSN:}
environment: ${SENTRY_ENVIRONMENT:development}
traces-sample-rate: 0
# Server Configuration
server:
port: 8080