Skip to content

Feat/24 gateway 모니터링 설정 - #25

Merged
mimimya merged 2 commits into
devfrom
feat/24-monitoring
May 20, 2026
Merged

mimimya merged 2 commits into
devfrom
feat/24-monitoring

Conversation

@mimimya

@mimimya mimimya commented May 20, 2026

Copy link
Copy Markdown
Contributor

📝 작업 내용

이번 PR에서 작업한 내용을 설명해주세요.

  • gateway 모니터링 설정

🚀 주요 변경 사항

완료한 이슈 번호
Close #24
관련된 이슈 번호 (닫고 싶지 않은 경우)
Related to #

✅ 자체 체크리스트 (필수)

  • ./gradlew build 실행 결과 정상 (인증샷 첨부)
  • Postman 테스트 완료 (인증샷 첨부)
  • 팀 내 컨벤션 준수 및 불필요한 로그, import 제거
  • 중요한 변경 사항이 팀에 공유되었는지

📸 테스트 인증샷

빌드 결과 및 Postman 실행 화면을 여기에 첨부해 주세요.

💬 리뷰어 전달사항 (선택)

특별히 봐주었으면 하는 부분이나 논의가 필요한 점을 적어주세요.

  • 논의점


📎 참고 자료

관련 문서, 레퍼런스 링크 등이 있다면 여기에 첨부해주세요.

Summary by CodeRabbit

New Features

  • Prometheus를 통한 애플리케이션 메트릭 모니터링 기능 추가
  • Spring Actuator 엔드포인트 활성화로 상태, 정보, 메트릭 조회 지원
  • Zipkin 연동으로 분산 추적 및 요청 추적 기능 추가
  • 메트릭 태그, 퍼센타일 및 히스토그램 통계 수집
  • 상세한 상태 정보 조회 활성화

Review Change Stack

@mimimya mimimya linked an issue May 20, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Prometheus 메트릭 레지스트리 의존성을 추가하고 Spring Actuator 관리 엔드포인트 설정을 통해 헬스, 메트릭, Prometheus 데이터 노출 및 Zipkin 분산 추적 샘플링과 엔드포인트를 구성합니다.

Changes

모니터링 및 추적 활성화

Layer / File(s) Summary
Prometheus 메트릭 및 Actuator 설정
build.gradle, src/main/resources/application.yml
Micrometer Prometheus 레지스트리 의존성을 추가하고, Actuator 엔드포인트(health, info, metrics, prometheus, gateway)를 노출하며, 메트릭 태그 및 분포 설정(백분위수, 히스토그램), Zipkin 분산 추적 샘플링(1.0), Zipkin API 엔드포인트 구성을 적용합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 분

Poem

🐰 메트릭의 빛, Prometheus 하늘을
추적의 실실, Zipkin 길을 따라
Actuator는 문을 열고, Micrometer는 손을 잡아
모니터링의 정원을 함께 가꾸네
관찰의 기쁨, 추적의 즐거움 ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive 링크된 이슈 #24가 극히 미흡한 내용(설명 없음, 체크리스트 없음)만 포함하여 명확한 요구사항이 없으므로 평가 불가능합니다. 이슈 #24에 구체적인 모니터링 요구사항, 구현 체크리스트, 예상 메트릭 항목을 추가하여 PR 변경 사항의 완성도를 검증할 수 있도록 개선하십시오.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목 'Feat/24 gateway 모니터링 설정'은 변경 사항의 주요 내용인 gateway 모니터링 설정 추가를 명확하게 나타냅니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항(의존성 추가, 설정 추가)이 gateway 모니터링 설정이라는 PR 목표와 일치합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/24-monitoring

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.

@hhegi hhegi 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.

👍👍

@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.

Actionable comments posted: 1

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

120-125: ⚡ Quick win

추적 설정을 환경변수 기반으로 분리해 운영 리스크를 줄이세요.

Line 122, Line 125가 고정값(1.0, localhost)이라 환경별 운영이 어렵고, 실서비스에서 비용/성능 부담이 커질 수 있습니다. 기본값을 두되 환경 변수로 오버라이드 가능하게 바꾸는 편이 안전합니다.

권장 수정 예시
   tracing:
     sampling:
-      probability: 1.0
+      probability: ${MANAGEMENT_TRACING_SAMPLING_PROBABILITY:0.1}
   zipkin:
     tracing:
-      endpoint: http://localhost:9411/api/v2/spans
+      endpoint: ${MANAGEMENT_ZIPKIN_TRACING_ENDPOINT:http://zipkin:9411/api/v2/spans}
🤖 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.yml` around lines 120 - 125, The tracing
configuration uses hardcoded values; change tracing.sampling.probability and
zipkin.tracing.endpoint to use environment-variable placeholders with sensible
defaults (e.g., ${TRACING_SAMPLING_PROBABILITY:1.0} and
${ZIPKIN_TRACING_ENDPOINT:http://localhost:9411/api/v2/spans}) so environments
can override them at runtime; update any references or docs to accept
TRACING_SAMPLING_PROBABILITY and ZIPKIN_TRACING_ENDPOINT and ensure the sampling
value is consumed as a number by the code that reads
tracing.sampling.probability.
🤖 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.

Inline comments:
In `@src/main/resources/application.yml`:
- Around line 104-109: The actuator configuration currently exposes sensitive
endpoints (gateway/metrics/prometheus/health details) while /actuator/** is
publicly accessible; update the application.yml entries so
management.endpoints.web.exposure.include is narrowed (e.g. only "health,info"
or empty), set management.endpoint.health.show-details: when_authorized (not
always), and disable or set management.endpoint.gateway.enabled: false if not
required; additionally ensure your security configuration blocks unauthenticated
access to /actuator/** (adjust the public path that currently exposes
/actuator/** to require authentication or a specific role).

---

Nitpick comments:
In `@src/main/resources/application.yml`:
- Around line 120-125: The tracing configuration uses hardcoded values; change
tracing.sampling.probability and zipkin.tracing.endpoint to use
environment-variable placeholders with sensible defaults (e.g.,
${TRACING_SAMPLING_PROBABILITY:1.0} and
${ZIPKIN_TRACING_ENDPOINT:http://localhost:9411/api/v2/spans}) so environments
can override them at runtime; update any references or docs to accept
TRACING_SAMPLING_PROBABILITY and ZIPKIN_TRACING_ENDPOINT and ensure the sampling
value is consumed as a number by the code that reads
tracing.sampling.probability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: afde8e6d-1a57-4713-9469-44a6324690ce

📥 Commits

Reviewing files that changed from the base of the PR and between feecd78 and 94b5604.

📒 Files selected for processing (2)
  • build.gradle
  • src/main/resources/application.yml

Comment on lines +104 to +109
include: health, info, metrics, prometheus, gateway
endpoint:
health:
show-details: always
gateway:
enabled: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Actuator 민감 정보가 익명으로 노출될 수 있습니다.

Line 104-109 설정은 gateway/metrics/prometheushealth 상세정보를 노출합니다. 현재 파일의 Line 97에서 /actuator/**가 공개 경로라, 운영 토폴로지/메트릭이 비인증 사용자에게 열릴 수 있습니다. 운영 환경 기준으로는 최소 노출 + 인증 기반 상세 조회로 제한하는 게 안전합니다.

권장 수정 예시
 management:
   endpoints:
     web:
       exposure:
-        include: health, info, metrics, prometheus, gateway
+        include: health, prometheus
   endpoint:
     health:
-      show-details: always
+      show-details: when_authorized
     gateway:
-      enabled: true
+      enabled: false
 jwt:
   public-paths:
     - /api/v1/auth/**
-    - /actuator/**
     - /api/v1/payment/webhook
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
include: health, info, metrics, prometheus, gateway
endpoint:
health:
show-details: always
gateway:
enabled: true
include: health, prometheus
endpoint:
health:
show-details: when_authorized
gateway:
enabled: false
🤖 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.yml` around lines 104 - 109, The actuator
configuration currently exposes sensitive endpoints
(gateway/metrics/prometheus/health details) while /actuator/** is publicly
accessible; update the application.yml entries so
management.endpoints.web.exposure.include is narrowed (e.g. only "health,info"
or empty), set management.endpoint.health.show-details: when_authorized (not
always), and disable or set management.endpoint.gateway.enabled: false if not
required; additionally ensure your security configuration blocks unauthenticated
access to /actuator/** (adjust the public path that currently exposes
/actuator/** to require authentication or a specific role).

@mimimya
mimimya merged commit b10b7f3 into dev May 20, 2026
4 of 5 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.

[FEAT] 모니터링

3 participants