Skip to content

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Aug 3, 2025

작업 요약

  • admin 모니터링 추가

Issue Link

#206

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 신규 기능

    • 관리자 및 사용자 모니터링을 위한 Prometheus와 Grafana 서비스가 각각 별도로 추가되었습니다.
    • 관리자 API에 Prometheus 기반 모니터링 및 메트릭 수집 기능이 활성화되었습니다.
  • 버그 수정

    • 사용자 및 관리자 모니터링 환경이 분리되어 컨테이너 및 볼륨 이름 충돌이 방지되었습니다.
  • 작업 자동화 및 배포

    • 워크플로우와 배포 스크립트가 새로운 모니터링 서비스 및 구성 파일을 반영하도록 개선되었습니다.
    • 불필요한 디버그 출력이 제거되었습니다.

@Jjiggu Jjiggu self-assigned this Aug 3, 2025
@Jjiggu Jjiggu added the enhancement New feature or request label Aug 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 3, 2025

Walkthrough

이 변경사항은 관리자 및 사용자 환경에 Prometheus와 Grafana 모니터링 스택을 추가 및 분리하고, 관련 Docker Compose 파일, 배포 스크립트, GitHub Actions 워크플로를 업데이트합니다. 또한, nowait-app-admin-api 모듈에 Prometheus 메트릭 수집을 위한 의존성을 추가합니다.

Changes

Cohort / File(s) Change Summary
Admin 모니터링 도입 및 배포 워크플로
.github/workflows/deploy-admin-docker.yml, docker-compose.admin-monitoring.yml, scripts/deploy-admin-docker.sh
Prometheus 및 Grafana를 위한 admin 전용 Docker Compose 파일 추가, 워크플로에서 Prometheus 구성 파일 생성 및 복사 단계 추가, 배포 스크립트에서 관련 컨테이너 관리 및 compose 명령 확장.
User 모니터링 분리 및 워크플로
.github/workflows/deploy-user-docker.yml, docker-compose.user-monitoring.yml, scripts/deploy-user-docker.sh
사용자용 Prometheus/Grafana 컨테이너와 볼륨 이름을 별도로 지정하여 환경 분리, 워크플로와 배포 스크립트에서 관련 파일명 및 컨테이너명 변경, 불필요한 디버그 단계 제거.
Admin API 모듈 모니터링 활성화
nowait-app-admin-api/build.gradle
Spring Boot Actuator 및 Micrometer Prometheus registry 의존성 추가로 Prometheus 메트릭 지원 활성화.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant EC2
    participant Docker Compose
    participant Prometheus-Admin
    participant Grafana-Admin
    participant nowait-app-admin-api

    GitHub Actions->>EC2: SCP로 docker-compose.admin-monitoring.yml, prometheus-admin.yml 복사
    GitHub Actions->>EC2: deploy-admin-docker.sh 실행
    EC2->>Docker Compose: docker-compose -f ... up
    Docker Compose->>Prometheus-Admin: 컨테이너 시작
    Docker Compose->>Grafana-Admin: 컨테이너 시작 (Prometheus-Admin 의존)
    Prometheus-Admin->>nowait-app-admin-api: 메트릭 수집
    Grafana-Admin->>Prometheus-Admin: 데이터 조회
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–25 minutes

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c9da02 and 5ed7cfb.

📒 Files selected for processing (4)
  • docker-compose.admin-monitoring.yml (1 hunks)
  • docker-compose.user-monitoring.yml (2 hunks)
  • scripts/deploy-admin-docker.sh (1 hunks)
  • scripts/deploy-user-docker.sh (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • scripts/deploy-user-docker.sh
🚧 Files skipped from review as they are similar to previous changes (3)
  • scripts/deploy-admin-docker.sh
  • docker-compose.admin-monitoring.yml
  • docker-compose.user-monitoring.yml
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#206-prometheus-grafana

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot requested a review from HyemIin August 3, 2025 12:48
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (1)
.github/workflows/deploy-admin-docker.yml (1)

119-123: 동일 문제 – docker/login-action 버전

위 스텝과 같은 이유로 동일한 수정이 필요합니다.

🧹 Nitpick comments (7)
scripts/deploy-user-docker.sh (1)

14-23: 모니터링 컨테이너 제거 로직이 nowait-app-user-api 존재 여부에 의존합니다

API 컨테이너가 없으면 Prometheus/Grafana 컨테이너를 제거하지 않아 중복 실행될 수 있습니다. 블록을 분리하거나 docker-compose down 으로 전체 스택을 정리하는 쪽이 더 안전합니다.

.github/workflows/deploy-user-docker.yml (1)

96-104: 스텝 명칭과 파일명 불일치

스텝 이름은 Copy prometheus.yml to EC2지만, 실제 복사하는 파일은 prometheus-user.yml입니다. 이름을 일치시켜 혼동을 줄여주세요.

.github/workflows/deploy-admin-docker.yml (1)

50-53: docker/login-action 버전 업그레이드 권장

Static analysis에서 docker/login-action@v2가 구버전 러너와 호환되지 않을 수 있다고 경고합니다. @v3 또는 최신 마이너 버전을 명시하여 문제를 예방하세요.

scripts/deploy-admin-docker.sh (2)

14-23: 모니터링 컨테이너 제거 조건 개선 필요

관리 API 컨테이너가 없으면 Prometheus/Grafana 컨테이너를 제거하지 않아 중복 실행 위험이 있습니다. 별도 if 블록으로 분리하거나 docker-compose -p nowait_dev down 으로 스택 전체를 정리하는 방식을 권장합니다.


28-29: 재배포 시 이미지 최신화 옵션 고려

태그가 동일하면 docker-compose pull 이 캐시된 레이어를 사용할 수 있습니다. --pull always(compose v2) 또는 up --force-recreate 옵션을 추가해 항상 최신 이미지를 받도록 해주세요.

docker-compose.admin-monitoring.yml (1)

3-3: latest 태그 사용은 재현성 저해

prom/prometheus:latest, grafana/grafana:latest 태그는 이미지 업데이트 시 예기치 못한 변경을 불러올 수 있습니다.
운영 배포라면 명시적인 버전 태그(예: grafana/grafana:10.2.3)로 고정할 것을 권장합니다.

Also applies to: 16-16

docker-compose.user-monitoring.yml (1)

3-3: 이미지 태그 고정 권장

재현성과 롤백을 위해 Prometheus·Grafana 이미지를 구체적인 버전으로 고정하는 것을 권장합니다.

Also applies to: 16-16

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2fd05d and 0c9da02.

📒 Files selected for processing (7)
  • .github/workflows/deploy-admin-docker.yml (4 hunks)
  • .github/workflows/deploy-user-docker.yml (2 hunks)
  • docker-compose.admin-monitoring.yml (1 hunks)
  • docker-compose.user-monitoring.yml (2 hunks)
  • nowait-app-admin-api/build.gradle (1 hunks)
  • scripts/deploy-admin-docker.sh (1 hunks)
  • scripts/deploy-user-docker.sh (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/deploy-admin-docker.yml

51-51: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


120-120: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (3)
nowait-app-admin-api/build.gradle (1)

73-78: Actuator 엔드포인트 보안 설정 확인 필요

Spring Boot Actuator를 추가하면서 /actuator/** 경로가 기본으로 노출됩니다. 프로덕션에서는 /actuator/prometheus 외 엔드포인트를 인증·IP 화이트리스트 등으로 보호해야 합니다.
management.endpoints.web.exposure.include=prometheus 설정 또는 SecurityFilterChain으로 차단했는지 확인 부탁드립니다.

.github/workflows/deploy-user-docker.yml (1)

70-75: 새 Secret 키 존재 여부 확인 필요

PROMETHEUS_DEV_USER_YML 시크릿을 사용하도록 변경되었습니다. 레포지토리/조직 시크릿에 동일한 키가 없으면 디코딩 단계에서 실패합니다. CICD 시크릿 설정을 다시 확인해주세요.

.github/workflows/deploy-admin-docker.yml (1)

73-78: 시크릿 키 PROMETHEUS_DEV_ADMIN_YML 등록 여부 확인

Prometheus 설정 파일을 디코딩합니다. 해당 시크릿이 존재하지 않으면 배포가 실패하니 사전 확인이 필요합니다.

@Jjiggu Jjiggu merged commit 3f79402 into develop Aug 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants