Skip to content

[CHORE] 커스텀 메트릭 지표 논의 및 구현#197

Merged
leegwichan merged 2 commits intodevelopfrom
chore/#194
Jul 11, 2025
Merged

[CHORE] 커스텀 메트릭 지표 논의 및 구현#197
leegwichan merged 2 commits intodevelopfrom
chore/#194

Conversation

@leegwichan
Copy link
Member

@leegwichan leegwichan commented Jul 10, 2025

🚩 연관 이슈

closed #194

🗣️ 리뷰 요구사항 (선택)

  • 일단 외부 API를 사용하는 부분에 커스텀 메트릭 지표를 추가하였습니다.
    • dev 환경에 반영된다면, Datadog 모니터링 대시보드에 추가할 예정입니다.
  • 이외 추가적으로 남기고 싶은 모니터링 지표 or 로그가 있다면 코멘트로 남겨주세요!

Summary by CodeRabbit

  • 신규 기능

    • 메서드 실행 시간을 측정하는 모니터링 기능이 추가되었습니다.
    • Discord 알림 및 Google OAuth 관련 요청에 대한 성능 지표가 수집됩니다.
  • 기타

    • 모니터링 설정이 도입되어 애플리케이션의 주요 동작에 대한 메트릭 수집이 가능해졌습니다.

@coderabbitai
Copy link

coderabbitai bot commented Jul 10, 2025

"""

Walkthrough

Micrometer의 @Timed 어노테이션이 주요 외부 API 호출 및 에러 알림 메서드에 추가되었습니다. 또한 메서드 레벨 타이밍 메트릭 수집을 위한 Spring 설정 클래스가 신규로 도입되었습니다. 애플리케이션에서 커스텀 메트릭 수집이 가능하도록 구성되었습니다.

Changes

파일/경로 변경 요약
src/main/java/com/debatetimer/client/notifier/DiscordNotifier.java sendErrorMessage 메서드에 @Timed("discord.send_error_message") 어노테이션 추가
src/main/java/com/debatetimer/client/oauth/OAuthClient.java requestToken, requestMemberInfo 메서드에 각각 @Timed 어노테이션 추가
src/main/java/com/debatetimer/config/MonitoringConfig.java Micrometer 메트릭 활성화를 위한 MonitoringConfig 설정 클래스 및 빈 추가

Assessment against linked issues

Objective Addressed Explanation
도메인적으로 중요한 커스텀 메트릭 수집 기능 구현 (#194)

Suggested reviewers

  • unifolio0
  • coli-geonwoo
    """

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1925240 and b4303bf.

📒 Files selected for processing (1)
  • src/main/java/com/debatetimer/config/MonitoringConfig.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/debatetimer/config/MonitoringConfig.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-push
✨ Finishing Touches
  • 📝 Generate Docstrings

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

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.

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

🧹 Nitpick comments (3)
src/main/java/com/debatetimer/client/notifier/DiscordNotifier.java (1)

38-49: 메트릭 이름·태그에 대한 세분화 고려

@Timed("discord.send_error_message") 만으로는 추후 여러 Discord 관련 메트릭이 추가될 때 충돌·혼동이 생길 수 있습니다.

  • 메트릭 prefix (discord) 뒤에 목적(예: error) vs. 동작(예: send_message)이 혼재되어 있습니다. 규칙을 확정해 두는 편이 장기 유지보수에 유리합니다.
  • 실패/성공 여부, 예외 타입 등 추가 태그를 걸어두면 대시보드에서 필터링‧경고 설정이 편리합니다.

예시:

@Timed(
    value = "discord.error.message",
    extraTags = {"result", "success"}   // try/catch 로 갱신
)

지표 체계 확장 계획이 있다면 지금 컨벤션을 맞춰두는 것을 권장합니다.

src/main/java/com/debatetimer/client/oauth/OAuthClient.java (2)

28-37: 메트릭 명 컨벤션 통일 및 예외 태깅 제안

@Timed("google.request_token") 는 직관적이지만, 이후 다른 프로바이더가 추가되면 이름 길이가 달라질 수 있습니다.

  • external.google.token.request 처럼 external.<provider>.<resource>.<action> 규칙을 미리 잡아두면 확장성↑
  • extraTags={"status","success"} 등으로 성공/실패를 태깅하면 알람 설정이 쉬워집니다.

예)

@Timed(
    value = "external.google.token.request",
    extraTags = {"outcome", "success"}
)

현재 단계에서 필수는 아니나 모니터링 ROI 를 높이려면 고민해 볼 만합니다.


39-46: requestMemberInfo 동일 컨벤션 적용 권장

위 토큰 요청과 동일한 네이밍·태그 규칙을 적용하여 대시보드 가독성을 유지하세요.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51b9fd0 and 1925240.

📒 Files selected for processing (3)
  • src/main/java/com/debatetimer/client/notifier/DiscordNotifier.java (2 hunks)
  • src/main/java/com/debatetimer/client/oauth/OAuthClient.java (3 hunks)
  • src/main/java/com/debatetimer/config/MonitoringConfig.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-push
🔇 Additional comments (2)
src/main/java/com/debatetimer/client/notifier/DiscordNotifier.java (1)

5-5: Micrometer @Timed 적용을 위한 import 추가 확인 완료

io.micrometer.core.annotation.Timed import 추가가 정확합니다. 다른 영향도 없습니다.

src/main/java/com/debatetimer/client/oauth/OAuthClient.java (1)

8-8: Micrometer import 추가 확인 완료

필요한 Timed import 가 정확히 반영되었습니다.

@github-actions
Copy link

github-actions bot commented Jul 10, 2025

Test Results

 69 files   69 suites   11s ⏱️
187 tests 187 ✅ 0 💤 0 ❌
199 runs  199 ✅ 0 💤 0 ❌

Results for commit b4303bf.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 10, 2025

📝 Test Coverage Report

Overall Project 84.63% 🍏
Files changed 100% 🍏

File Coverage
MonitoringConfig.java 100% 🍏
OAuthClient.java 58.18% 🍏
DiscordNotifier.java 0% 🍏

Copy link
Contributor

@unifolio0 unifolio0 left a comment

Choose a reason for hiding this comment

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

/noti
@leegwichan
위에 토끼 리뷰 확인해주세요. approve했습니다.

@leegwichan
Copy link
Member Author

/noti @coli-geonwoo
토끼 리뷰 반영했다. Approve 달라 이말입니다.

Copy link
Contributor

@coli-geonwoo coli-geonwoo left a comment

Choose a reason for hiding this comment

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

/noti

고생많으셨습니다 커찬~

@leegwichan leegwichan merged commit ded82b5 into develop Jul 11, 2025
5 checks passed
@leegwichan leegwichan deleted the chore/#194 branch July 11, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore 기타

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE] 커스텀 메트릭 지표 논의 및 구현

3 participants