모니터링 SDK 추가#75
Conversation
Summary of ChangesHello @swthewhite, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 애플리케이션에 모니터링 기능을 통합하여 가시성을 향상시키는 것을 목표로 합니다. Prometheus를 통해 메트릭을 수집하고 Loki를 통해 로그를 중앙 집중화함으로써, 애플리케이션의 상태와 성능을 보다 효과적으로 추적하고 분석할 수 있게 됩니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
안녕하세요. 모니터링 SDK 추가를 위한 PR 잘 보았습니다. Prometheus와 Loki를 연동하여 애플리케이션의 메트릭과 로그를 수집할 수 있도록 기반을 마련해주셨네요. 전반적으로 변경 사항은 명확하고 목적에 부합합니다. 다만, logback-spring.xml 파일에 Loki 서버 주소가 하드코딩되어 있어 환경에 따라 유연하게 대처하기 어려운 점이 있습니다. 이 부분을 외부 설정으로 분리하도록 수정 제안을 남겼습니다. 이 부분을 수정하면 더 완성도 높은 코드가 될 것 같습니다. 수고하셨습니다!
| <configuration> | ||
| <appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender"> | ||
| <http> | ||
| <url>http://MONITORING_SERVER_IP:3100/loki/api/v1/push</url> |
There was a problem hiding this comment.
Loki URL이 플레이스홀더(MONITORING_SERVER_IP)와 함께 하드코딩되어 있습니다. 이 설정은 환경별로 달라져야 하므로 application.yml 파일로 외부화하는 것이 좋습니다. 이렇게 하면 코드를 변경하지 않고도 로컬, 개발, 운영 환경에 맞게 설정을 변경할 수 있어 유연성이 높아집니다.
logback-spring.xml 파일에 <springProperty>를 사용하여 application.yml의 프로퍼티를 가져올 수 있습니다. 그리고 application.yml에 각 프로필에 맞는 Loki URL을 추가해주세요.
logback-spring.xml 수정 예시:
<configuration>
<springProperty scope="context" name="lokiUrl" source="loki.url" defaultValue="http://localhost:3100/loki/api/v1/push"/>
<appender name="LOKI" ...>
<http>
<url>${lokiUrl}</url>
</http>
...
</appender>
...
</configuration>application.yml 추가 예시:
loki:
url: http://your-loki-host:3100/loki/api/v1/push| <url>http://MONITORING_SERVER_IP:3100/loki/api/v1/push</url> | |
| <url>${loki.url}</url> |
🍀 이슈 번호
✅ 작업 사항
⌨ 기타