Skip to content

feat: Micrometer Prometheus 메트릭 수집 설정 추가 - #675

Merged
1210thatman merged 1 commit into
developfrom
feature/add-prometheus-metrics
Jun 9, 2026
Merged

1210thatman merged 1 commit into
developfrom
feature/add-prometheus-metrics

Conversation

@1210thatman

@1210thatman 1210thatman commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • API별 호출 횟수 및 응답시간 모니터링을 위해 Spring Boot Actuator + Micrometer Prometheus 연동 추가
  • 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 엔드포인트 설정 추가

확인 방법

배포 후 아래 엔드포인트에서 메트릭 조회 가능

GET /dsm-pick/actuator/prometheus

Test plan

  • 빌드 정상 확인
  • /actuator/prometheus 엔드포인트 응답 확인
  • http_server_requests_seconds_count 메트릭으로 API별 호출 수 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • 애플리케이션 모니터링 및 메트릭 수집 기능 추가
    • 헬스 체크 및 프로메테우스 호환 메트릭 엔드포인트 노출

API별 호출 횟수 및 응답시간 모니터링을 위해
Spring Boot Actuator + Micrometer Prometheus 연동 추가.
/dsm-pick/actuator/prometheus 엔드포인트에서 메트릭 조회 가능.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Walkthrough

이 PR은 Spring Boot Actuator와 Micrometer Prometheus 라이브러리를 추가하여 애플리케이션 모니터링 기능을 활성화합니다. 의존성 상수 정의, 빌드 파일 통합, 그리고 Prometheus 메트릭 수집을 위한 애플리케이션 구성을 포함합니다.

Changes

Prometheus 메트릭 모니터링 설정

Layer / File(s) Summary
Prometheus 의존성 및 Actuator 설정
buildSrc/src/main/kotlin/Dependencies.kt, build.gradle.kts, src/main/resources/application.yaml
Dependencies 상수로 ACTUATOR와 MICROMETER_PROMETHEUS를 정의하고, 빌드 의존성에 추가한 후, application.yaml에서 prometheus,health 엔드포인트 노출, Prometheus 엔드포인트 활성화, 그리고 pick-core 애플리케이션 태그를 설정합니다.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 메트릭 수집의 마법이 시작되네,
Prometheus 모니터링 이제 준비 완료,
의존성과 설정 조화를 이루어,
애플리케이션의 건강을 지켜내리라! 📊✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request 제목은 '메트릭 수집 설정 추가'로 변경 사항의 주요 목적을 명확하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-prometheus-metrics

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/resources/application.yaml (1)

75-85: Actuator(health/prometheus) 접근 통제는 현재 Spring Security denyAll로 차단되는 상태로 보입니다.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fc1d437 and c53785e.

📒 Files selected for processing (3)
  • build.gradle.kts
  • buildSrc/src/main/kotlin/Dependencies.kt
  • src/main/resources/application.yaml

@1210thatman
1210thatman merged commit 35876ce into develop Jun 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants