mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 13:49:36 +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:
parent
5fe0dfc139
commit
df1d1dfdd3
9 changed files with 818 additions and 6 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue