Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

개발서버 모니터링 세팅 #84

Merged
merged 31 commits into from
Feb 7, 2024
Merged

Conversation

jinhoon227
Copy link
Contributor

@jinhoon227 jinhoon227 commented Feb 6, 2024

⭐️ Issue Number

🚩 Summary

로그백, Spring actuator, prometheus, node-exporter, promtail, grafana, loki 를 이용하여 로그를 수집하고 모니터링 합니다.

🛠️ Technical Concerns

AOP

AOP 를 이용하여 추가로 로그를 생성합니다. AOP 를 이용해 Exception 발생시 warn 수준의 로그를 기록하고, 모든 API 요청에 대해 시간을 측정하여 debug 수준의 로그로 기록합니다.

로그백

로그백을 이용하여 로그를 관리합니다. debug, info, warn, error 로 로그레벨을 구분하여 "파일" 로 저장을 합니다.

Spring actuator

Spring actuator 를 이용하여 Spring Application 에 대한 정보를 수집합니다. 해당 정보를 통해 Heap memory, GC 사용률 정보를 알 수 있습니다. 기본적으로 :8080/actuator/prometheus 로 엔드포인트가 되어있지만, application-dev 의 별도의 설정을 통해 엔드포인트를 변경했습니다.(보안상이유)

node-exporter

node-exporter 를 docker 로 띄워 호스트(EC2, GCP) 에 대한 정보를 수집합니다.

Prometheus

Prometheus 를 통해 spring actuator, node-exporter 에서 수집한 정보를 주기적으로 가져와 grafana 로 전송합니다.

promtail

로그백을 통해 저장해둔 로그파일을 로키 서버로 전송합니다.

loki

loki 서버는 promtail 에서 로그정보를 받고 grafana 로 전송합니다.

grafana

grafana 는 수집된 로그정보를 시각화해서 보여줍니다. 그리고 알람을 설정해 서버가 다운됐을때 디스코드로 알람을 보냅니다.

📋 To Do

  • 운영서버에도 적용

close #73

@jinhoon227 jinhoon227 added the ✨ Feature 기능 관련 label Feb 6, 2024
@jinhoon227 jinhoon227 self-assigned this Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

Test Results

11 tests  ±0   11 ✅ ±0   14s ⏱️ ±0s
 8 suites ±0    0 💤 ±0 
 8 files   ±0    0 ❌ ±0 

Results for commit 428e1c1. ± Comparison against base commit 0203a01.

♻️ This comment has been updated with latest results.

@jinhoon227 jinhoon227 changed the title 서버 모니터링 세팅 개발서버 모니터링 세팅 Feb 7, 2024
@jinhoon227 jinhoon227 requested a review from sungjindev February 7, 2024 17:41
Copy link
Contributor

@sungjindev sungjindev left a comment

Choose a reason for hiding this comment

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

많은 기능들이 추가되었군요~ 고생 많으셨습니다!

@jinhoon227 jinhoon227 merged commit 233d5c5 into develop Feb 7, 2024
3 checks passed
@jinhoon227 jinhoon227 deleted the feature/set-logging(#73) branch February 7, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

개발서버 모니터링 세팅
2 participants