-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/#12 모니터링 연동 #28
Open
seokbeom00
wants to merge
17
commits into
develop
Choose a base branch
from
feature/#12
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+182
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌱 관련 이슈
📌 작업 내용 및 특이사항
메트릭 수집
참고: https://woo-chang.tistory.com/78
스프링의 actuator를 이용하여 메트릭 데이터를 받아올 수 있는 엔드포인트를 열어준 뒤, 프로메테우스가 해당 엔드포인트를 통해 메트릭 데이터들을 수집하고, 그라파나가 해당 정보를 바탕으로 UI로 뿌려주는 방식입니다.
현재 배포 서버는 우분투 환경의 도커 컨테이너 형태로 배포되어 있기 때문에, (도커 컴포즈 활용 중) 프로메테우스와 그라파나도 동일하게 도커 컴포즈로 컨테이너화 해서 사용하는 방식을 채택했습니다.
결과적으로 모니터링 대상이 되는 서버와 모니터링 관련 이미지가 각각 컨테이너 상태로, 같은 내부 네트워크를 공유하도록 했습니다.
현재는 요청 수와 서버가 살아있는지 정도의 메트릭 정보만을 UI에 표시해두었습니다.
로그 수집
로그 수집을 위해서 로키와 프롬테일을 사용했습니다.
프롬테일이 대상이 되는 서버에서 로그를 수집하고, 로키가 저장 및 검색을 수행한다고 생각하시면 됩니다.
로키는 기존 elasticsearch 보다 저장 비용이 낮습니다. 메트릭 기반 프로메테우스와 유사한 아키텍처를 가지고 있습니다.
JSON을 직접 인덱싱하는 방식이 아닌 label을 기반으로 로그를 인덱싱하기 떄문에 label링을 로그에 해주어야 합니다.
현재는 status 필드를 기준으로, 500번대 로그만 수집하고 있는 상태입니다.
📚 기타