You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
게이지: 임의로 오르내릴 수 있는 값 - CPU/메모리 사용량, 사용중인 커넥션CPU 사용량의 현재 상태를 계속 측정하고 그 값을
그대로 그래프에 출력하면 과거부터 현재까지의 사용량을 알 수 있음. 시각화하기 가장 쉬운 메트릭임
카운터: 단순하게 증가하는 단일 누적 값 - HTTP 요청 수, 로그 발생 수HTTP 요청 메트릭을 그래프로 표현하면 계속해서 증가하는 누적 값이다. 이렇게 증가만 하는 그래프에서는 특정 시간에 얼마나 요청이 들어왔는지 파악하기 힘들다. 이를 위해 increase() rate() 같은 함수를 지원함

increase(http_server_requests_seconds_count{uri="/actuator/prometheus"}[1m])

rate(http_server_requests_seconds_count{uri="/actuator/prometheus"}[1m])
rate()는 범위 벡터에서 초당 평균 증가율을 계산한다.increase()가 숫자를 직접 카운트한다면, rate()는 여기에 초당 평균을 나누어 계산함
irate(http_server_requests_seconds_count{uri="/actuator/prometheus"}[1m])
irate()는 rate와 유사하지만, 범위 벡터에서 초당 순간 증가율을 계산함Grafana
설치 및 설정
https://grafana.com/grafana/download 를 통해 다운로드
https://hub.docker.com/r/grafana/grafana 의 도커 이미지 활용
그라파나: 프로메테우스에 적재된 메트릭 데이터를 불러서 사용자가 보기 편하게 보여주는 대시보드 (시각화)

그라파나 접속 후,
Configuration - Add data source - Prometheus - prometheus 주소 입력 - save & test
대시보드 생성
공유 대시보드 활용
https://grafana.com/grafana/dashboards
이미 누군가 만들어둔 수 많은 대시보드가 공개되어 있다. 우리는 스프링 부트와 마이크로미터를 사용해서 만든 대시보드를 가져다가 사용해보자. 검색창에 spring이라고 검색하면 다양한 대시보드를 확인할 수 있다.
스프링 부트 시스템 모니터 대시보드 불러오기
https://grafana.com/grafana/dashborads/11378-justai-system-monitor
사이트에 접속한 다음 Copy Id to clipboard를 선택하거나 ID:11378의 숫자를 저장한다.
대시보드 불러오기
대시보드를 확인해보면 거의 대부분의 메트릭을 대시보드에 표현한 것을 확인할 수 있다. 각각의 항목들을 보고 대시보드를 어떻게 구성해야 하는지도 학습할 수 있다. 참고로 일부 데이터의 경우 스프링 부트나 기타 라이브러리의 버전이 변함에 따라 동작하지 않는 기능들도 있다.
Beta Was this translation helpful? Give feedback.
All reactions