R&D
SpringBoot APM - Prometheus 란?
devTak
2023. 4. 20. 11:57
반응형
APM 이란?
- Application Perfomance Manager
- 성능관리모니터링 시스템이라고 할 수 있다.
APM OpenSource
maven repo | github star | 구글 검색 결과 | |
pinpoint | 237 | 12,700 | 약 226,000 |
scouter | 16 | 1,900 | 약 77,900 |
prometheus | 532 | 47,400 | 약 721,000 |
elasticAPM | 0 | 314 | 약 485,000 |
Prometheus(프로메테우스)
- 오픈 소스 시스템 모니터링 및 경고 ToolKit
- Exporter 로 부터 데이터를 수집하여 데이터를 시각화한다.
- Pull 방식의 Metric 데이터를 수집한다.
- PromQL 방식의 시계열 쿼리 및 집계한다.
Setting
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
metrics_path: '/v1/actuator/prometheus'
scrape_interval: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["localhost:8082"]
- scrpe_configs : 스크랩할 서버(Exporter) 설정 정보
- sarape_interval : 메트릭 정보 스크랩 수집 간격
GUI
메트릭 정보
Metric Type
- Counter
- Guage
- Histogram
- Summary
Counter
- 0부터 시작하여, 증가할 수 있는 누적 메트릭
- EX : 요청 수 및 완료 된 작업 수
Guage
- 단일 숫자 값을 나타내는 메트릭
- 현재 메모리 사용량, 동시 요청 수 등 증감이 가능
Histogram
- 구간별 데이터 취합에 특화되어있는 메트릭
- EX : 히트맵, 구간별 분포 그래프
Summary
- 히스토그램과 유사하나, 정확한 계산 비용이 발생
- EX : 분위수 단위 계산 값을 볼 때 사용
반응형