Skip to content

Conversation

@hyh1016
Copy link
Collaborator

@hyh1016 hyh1016 commented Aug 21, 2025

📌 관련 이슈

#67

📝 작업 개요

metrics 수집을 위한 추가 작업

✅ 작업 사항

  • 모니터링 관련 소스 변경이 있을 때에만 모니터링 compose 재기동 트리거링
  • 동일 도커 네트워크로 묶이지 않는 문제 해결

Summary by CodeRabbit

  • Chores

    • 모니터링 배포 워크플로우 트리거를 관련 변경에만 반응하도록 조정.
    • 배포 업로드 대상 경로를 홈 디렉터리로 변경.
  • Refactor

    • Docker Compose 네트워크에 명시적 이름을 부여하고 외부 네트워크로 전환(사전 생성 필요).
    • Prometheus 스크레이프 대상을 gamchi-app으로 업데이트하여 서비스 명칭과 일치.

@hyh1016 hyh1016 requested a review from pythonstrup August 21, 2025 13:34
@hyh1016 hyh1016 self-assigned this Aug 21, 2025
@hyh1016 hyh1016 added the enhancement New feature or request label Aug 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 21, 2025

Walkthrough

모니터링 배포 워크플로의 트리거 경로가 제한되었고, 원격 업로드 대상 경로가 홈 디렉터리로 변경되었습니다. docker-compose 구성에서는 공용 네트워크 이름을 명시하고, 모니터링 스택이 외부 네트워크를 사용하도록 전환되었습니다. Prometheus 스크랩 대상이 gamchi-app:8080으로 변경되었습니다.

Changes

Cohort / File(s) Summary of change
CI Workflow: trigger & upload path
.github/workflows/deploy-monitoring.yml
push 트리거에 경로 필터 추가(monitoring/**, 해당 워크플로 파일). 원격 업로드 대상이 ~/monitoring/에서 ~/로 변경되어 배포 스크립트의 DEPLOY_DIR=~/monitoring와 불일치 발생.
Docker networks: named & externalized
docker-compose-deploy.yml
networks.gamchi-networkname: gamchi-network 명시 추가.
Monitoring stack network external
monitoring/docker-compose.yml
networks.gamchi-networkdriver: bridge에서 external: true로 변경되어 기존 외부 네트워크에 연결하도록 수정.
Prometheus target
monitoring/prometheus/prometheus.yml
Spring Actuator 잡의 스크랩 대상 app:8080gamchi-app:8080으로 변경. 기타 설정 불변.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions (deploy-monitoring)
  participant SSH as Remote Host
  participant DC as docker-compose

  Dev->>GH: Push (paths: monitoring/**, workflow file)
  GH->>SSH: Upload artifacts to "~/" (changed)
  Note over GH,SSH: DEPLOY_DIR in script: ~/monitoring (mismatch risk)
  GH->>SSH: Run deploy script (uses DEPLOY_DIR)
  SSH->>DC: docker-compose -f monitoring/docker-compose.yml up -d
Loading
sequenceDiagram
  autonumber
  participant DC as docker-compose (monitoring)
  participant Net as docker network "gamchi-network" (external)
  participant App as gamchi-app
  participant Prom as Prometheus

  DC->>Net: Connect services to external network
  Note over DC,Net: Requires pre-existing "gamchi-network"
  Prom->>App: Scrape http://gamchi-app:8080/actuator/prometheus
  Prom-->>Prom: Relabel as configured
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • [#67] metrics 추가 #73: 동일한 모니터링 배포/네트워크/Prometheus 설정을 편집하며, 네트워크 구성 및 스크랩 타깃 변경이 겹칩니다.

Suggested reviewers

  • pythonstrup

Poem

(\_/) 토끼가 말해요:
업로드 길 바뀌었네, 집으로 착!
네트워크는 바깥세상, 이름 또렷 확!
프로메테우스여, gamchi-app을 향해 탁!
딸깍 배포, 딱딱 스크랩—
당근 같은 로그가 사각사각! 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/67

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

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: 0

🧹 Nitpick comments (4)
docker-compose-deploy.yml (1)

48-48: 파일 끝 개행(newline) 누락

YAMLlint 경고(new-line-at-end-of-file)를 없애기 위해 파일 말미에 개행을 추가해 주세요. 기능 영향은 없습니다.

   gamchi-network:
     driver: bridge
     name: gamchi-network
+
.github/workflows/deploy-monitoring.yml (1)

35-35: 원격 업로드 타깃 경로를 명시적으로 고정해 혼동 방지

source: "monitoring/" + target: "~/" 조합은 대부분 ~/monitoring에 디렉터리 전체가 업로드되어 현재 스크립트의 DEPLOY_DIR=~/monitoring와 실질적으로 일치합니다. 다만 액션별/버전별 동작 차이를 제거하려면 “대상 디렉터리 고정 + 내용물만 업로드”가 더 명확합니다.

아래처럼 바꾸면 중첩 디렉터리(~/monitoring/monitoring) 생성 가능성을 확실히 제거할 수 있습니다.

-          source: "monitoring/"
-          target: "~/"
+          # 디렉터리 내용물만 업로드
+          source: "monitoring/*"
+          target: "~/monitoring"

변경 후 최초 1회 배포에서 ~/monitoring 부재 시 자동 생성되는지(현재는 mkdir -p $DEPLOY_DIR가 있으므로 OK)와 업로드 경로가 기대대로 매핑되는지 한 번 확인 부탁드립니다.

monitoring/docker-compose.yml (2)

33-35: 외부 네트워크 의존성에 대한 배포 안전장치 제안

external: true로 전환하면 네트워크가 미리 존재하지 않을 경우 docker compose up이 실패합니다. 모니터링 배포 워크플로에 “없으면 생성” 가드를 추가하는 것을 권장드립니다.

예: .github/workflows/deploy-monitoring.yml의 SSH 스크립트 내에 아래 한 줄 추가

   DEPLOY_DIR=~/monitoring
   mkdir -p $DEPLOY_DIR
   cd $DEPLOY_DIR
+  docker network inspect gamchi-network >/dev/null 2>&1 || docker network create gamchi-network

또는 이 파일의 네트워크 섹션에 실제 네트워크명을 명시해 의도를 문서화할 수 있습니다(기능 동일).

 networks:
   gamchi-network:
-    external: true
+    external: true
+    name: gamchi-network

35-35: 파일 끝 개행(newline) 누락

YAMLlint 경고를 제거하기 위해 마지막 줄 뒤에 개행을 추가해 주세요.

 networks:
   gamchi-network:
     external: true
+
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8547cf1 and 9cb28f2.

📒 Files selected for processing (4)
  • .github/workflows/deploy-monitoring.yml (2 hunks)
  • docker-compose-deploy.yml (1 hunks)
  • monitoring/docker-compose.yml (1 hunks)
  • monitoring/prometheus/prometheus.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
monitoring/docker-compose.yml

[error] 35-35: no new line character at the end of file

(new-line-at-end-of-file)

docker-compose-deploy.yml

[error] 48-48: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
docker-compose-deploy.yml (1)

45-48: 명시적 네트워크 이름 지정으로 교차 스택 통신 안정화 — 좋습니다

name: gamchi-network를 지정해 모니터링 스택(external: true)과 동일한 네트워크 이름을 보장합니다. 런타임에 Compose 프로젝트 접두사로 인한 네이밍 변화가 없어져 접근성이 안정화됩니다.

.github/workflows/deploy-monitoring.yml (1)

7-9: 트리거 경로 필터 추가로 불필요한 배포 방지 — 좋습니다

모니터링 관련 변경에만 워크플로가 동작하도록 한 점이 배포 소음과 리소스 낭비를 줄입니다.

monitoring/prometheus/prometheus.yml (1)

13-13: 스크랩 타깃을 컨테이너명(gamchi-app)으로 전환 — 네트워크 모델과 정합성 확인 필요

gamchi-app:8080으로 변경은 외부 네트워크 상에서 컨테이너명 DNS를 활용하려는 의도로 보이며, docker-compose-deploy.ymlcontainer_name: gamchi-app(Line 29)과 일관됩니다. 다만 다음을 확인해 주세요:

  • 모니터링 스택이 접속하는 네트워크가 애플리케이션 컨테이너와 동일한 gamchi-network인지.
  • 첫 배포 시 해당 네트워크가 이미 존재해 Prometheus가 gamchi-app을 정상 해석하는지.

필요 시 서비스명(alias) 대신 컨테이너명에 의존한다는 점을 README/런북에 명시해 두면 향후 컨테이너명 변경 리스크를 줄일 수 있습니다.

@hyh1016 hyh1016 merged commit 7f40806 into main Aug 21, 2025
3 checks passed
@hyh1016 hyh1016 deleted the feature/67 branch September 24, 2025 12:32
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