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

feat: logback과 sentry를 활용한 에러 모니터링 툴 구축 #482

Merged
merged 10 commits into from
Nov 14, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ private String[] getAuthWhitelist() {
"/meeting/v2/org-user/**",
"/auth/v2",
"/auth/v2/**",
actuatorEndPoint + "/health"
actuatorEndPoint + "/health",
"/sentry" // prod에서 테스트 후 삭제
};
hoonyworld marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down Expand Up @@ -103,4 +104,4 @@ CorsConfigurationSource corsConfigurationSource() {
return source;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.sopt.makers.crew.main.global.sentry;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.sentry.Sentry;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
@RequestMapping("/sentry")
public class SentryController {

@GetMapping
public ResponseEntity<String> testSentry() { // prod에서 테스트 후 삭제
try {
throw new Exception("This is a test exception for Sentry.");
} catch (Exception e) {
Sentry.captureException(e);
log.error("Exception captured in Sentry", e);
return ResponseEntity.status(500).body("Exception captured in Sentry");
}
}
}
Loading