fix: actuator/health 메인 포트 404 응답 수정#424
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 본 PR은 메인 서버 포트에서 /actuator/health 엔드포인트가 404를 반환하는 문제를 해결합니다. Spring Boot 버전 제약으로 인해 관리 포트와 메인 포트가 분리되어 발생하는 접근성 문제를, 별도의 경량 컨트롤러를 도입하여 메인 포트에서도 상태 확인이 가능하도록 조치했습니다. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. 포트가 달라 헤매던 길, 메인 서버에 길을 텄네. UP이라는 짧은 응답, 이제는 안심하고 통과하네. Footnotes
|
There was a problem hiding this comment.
Code Review
이번 풀 리퀘스트에서는 애플리케이션의 상태를 확인하기 위한 /actuator/health 엔드포인트를 제공하는 HealthCheckController를 새롭게 추가하였습니다. 이에 대해 리뷰어는 매번 새로운 Map 인스턴스를 생성하는 대신 private static final 상수로 재사용하여 메모리 효율성을 높일 것을 제안하였으며, 임시 코드인 만큼 저장소 스타일 가이드에 맞춰 작성자 이름과 날짜가 포함된 FIXME 주석을 추가할 것을 권장했습니다.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| public class HealthCheckController { | ||
|
|
||
| @GetMapping("/actuator/health") | ||
| public Map<String, String> health() { | ||
| return Map.of("status", "UP"); | ||
| } |
There was a problem hiding this comment.
매번 새로운 Map 인스턴스를 생성하는 대신 private static final 상수로 선언하여 재사용하면 메모리 효율성을 높이고 GC 부하를 줄일 수 있습니다.
public class HealthCheckController {
private static final Map<String, String> HEALTH_STATUS = Map.of("status", "UP");
@GetMapping("/actuator/health")
public Map<String, String> health() {
return HEALTH_STATUS;
}…main-port fix: actuator/health 메인 포트 404 응답 수정
#️⃣ Issue Number
📝 요약(Summary)
GET /actuator/health요청 시 404가 발생하는 문제를 수정management.server.port: 9001설정으로 actuator가 메인 서버(9000)와 분리된 별도 관리 포트에서 서빙되고 있고, Docker 컨테이너에서도 9001은127.0.0.1에만 바인딩되어 있어 공개 도메인(9000)으로는/actuator/**경로 자체가 존재하지 않음management.endpoint.health.additional-path설정으로 해결하려 했으나 해당 기능은 Spring Boot 3.1+ 전용이며 본 프로젝트는 3.0.4를 사용 중이라 적용되지 않아, 대신global/handler/HealthCheckController를 신규 추가해 메인 서버 포트(9000)에서GET /actuator/health가{"status":"UP"}을 응답하도록 함/actuator/prometheus,/actuator/metrics)는 그대로 유지되어 Grafana Cloud 모니터링 연동에는 영향 없음SecurityConfig/JwtAuthenticationFilter의 화이트리스트에는 이미/actuator/health가 등록되어 있어 별도 보안 설정 변경없음💬 공유사항 to 리뷰어
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.