Repository navigation
feat: Micrometer Prometheus 메트릭 수집 설정 추가 - #675
Conversation
API별 호출 횟수 및 응답시간 모니터링을 위해 Spring Boot Actuator + Micrometer Prometheus 연동 추가. /dsm-pick/actuator/prometheus 엔드포인트에서 메트릭 조회 가능. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Walkthrough이 PR은 Spring Boot Actuator와 Micrometer Prometheus 라이브러리를 추가하여 애플리케이션 모니터링 기능을 활성화합니다. 의존성 상수 정의, 빌드 파일 통합, 그리고 Prometheus 메트릭 수집을 위한 애플리케이션 구성을 포함합니다. ChangesPrometheus 메트릭 모니터링 설정
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/resources/application.yaml (1)
75-85: Actuator(health/prometheus) 접근 통제는 현재 Spring SecuritydenyAll로 차단되는 상태로 보입니다.
application.yaml에서management.endpoints.web.exposure.include: prometheus,health및management.endpoint.prometheus.enabled: true로 Actuator 엔드포인트는 노출되지만,SecurityConfig.kt의 보안 규칙은SecurityPaths.PERMIT_ALL_ENDPOINTS만permitAll처리하고 그 외는.anyRequest().denyAll()로 차단합니다.SecurityPaths.kt의 허용 목록에/actuator/**(또는/prometheus,management.*)가 포함되어 있지 않아(명시적 예외 없음) Actuator 접근은 차단될 가능성이 큽니다.
다만management.server.port/management.server.base-path등으로 Actuator이 별도 포트/경로로 분리되면 보안 필터 체인 적용 여부가 달라질 수 있으니 그 경우도 확인 권장합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/resources/application.yaml` around lines 75 - 85, Actuator endpoints are exposed in application.yaml but likely blocked by the security rules in SecurityConfig.kt because SecurityPaths.PERMIT_ALL_ENDPOINTS doesn't include them; update the permit list in SecurityPaths.kt (or adjust SecurityConfig.kt) to allow actuator access by adding an explicit permit for "/actuator/**" (or specific endpoints like "/actuator/health" and "/actuator/prometheus") so the filter chain permits these paths, and verify behavior if management.server.port or management.server.base-path are set (adjust allowed paths accordingly).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/main/resources/application.yaml`:
- Around line 75-85: Actuator endpoints are exposed in application.yaml but
likely blocked by the security rules in SecurityConfig.kt because
SecurityPaths.PERMIT_ALL_ENDPOINTS doesn't include them; update the permit list
in SecurityPaths.kt (or adjust SecurityConfig.kt) to allow actuator access by
adding an explicit permit for "/actuator/**" (or specific endpoints like
"/actuator/health" and "/actuator/prometheus") so the filter chain permits these
paths, and verify behavior if management.server.port or
management.server.base-path are set (adjust allowed paths accordingly).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1c5ac25a-cc9a-4427-b21b-8cd3703de75b
📒 Files selected for processing (3)
build.gradle.ktsbuildSrc/src/main/kotlin/Dependencies.ktsrc/main/resources/application.yaml
Summary
build.gradle.kts및Dependencies.kt에 의존성 추가application.yaml에/actuator/prometheus,/actuator/health엔드포인트 노출 설정 추가변경 파일
buildSrc/src/main/kotlin/Dependencies.kt— ACTUATOR, MICROMETER_PROMETHEUS 상수 추가build.gradle.kts— 두 의존성 implementation 추가src/main/resources/application.yaml— management 엔드포인트 설정 추가확인 방법
배포 후 아래 엔드포인트에서 메트릭 조회 가능
Test plan
/actuator/prometheus엔드포인트 응답 확인http_server_requests_seconds_count메트릭으로 API별 호출 수 확인🤖 Generated with Claude Code
Summary by CodeRabbit