기존에 저희 회사에서 사용하던 모니터링은 Zabbix 였습니다.
컨테이너 모니터링 부분으로 옮겨가면서 변화가 필요하였고, 이에 대해서 프로메테우스를 활용한 모니터링 방법을 자연스럽게 고민하게 되었습니다.
이에 이영주님께서 테크세션을 진행하였고, 이에 발표자료를 올립니다.
5개의 부분으로 구성되어 있으며, 세팅 방법에 대한 내용까지 포함합니다.
01. Prometheus?
02. Usage
03. Alertmanager
04. Cluster
05. Performance
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
1. Open Source Consulting
국내 최고의 오픈소스 전문기업
Private/Public Cloud | Data Center to Cloud | Atlassian
H. www.osci.kr T. 02-516-0711 F. 02-516-0722
서울특별시 강남구 테헤란로83길 32 나라키움삼성동A빌딩 5층
Copyright 2019 Open Source Consulting Inc. All rights reserved.
5. 01. Prometheus?
• Prometheus?
⚫ 2012년 SoundCloud에서 몇몇의 개발자와 함께 시작.
⚫ 2016년 CNCF(Cloud Native Computing Foundation)의 두번 째 Memb
er.
⚫ PromQL이라는 자체언어를 이용해서 빠르게 검색가능.
⚫ Kubernates의 모니터링에 많이 쓰이게 되면서 각광받게 됨.
⚫ 초당 수백만 쿼리를 수행 할 수 있게 디자인 됨.
⚫ 기존 Monitoring system보다 성능이 월등히 좋음.
⚫ Openstack, AWS, Azure, GCE등 거의 모든 Platform 모니터링 가능.
9. 01. Prometheus?
• Prometheus Architecture
Target을 찾아서
자동으로 등록!!
push 방식 간접구현
(App이 여기에
metric을 push)
Prometheus가
이해할 수 있는
format으로 바꿔줌.
사람에게 알림을
보내주는 역할
Graph를
그리는 역할
다른 Prometheus의
metric도 가져올 수 있음
Prometheus Federation
15. 02. Usage
• Scraping
[root@yj26-ovstest3 ~]# curl localhost:9090/metrics |head -n 20
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 41814 0 41814 0 0 5023k 0 --:--:-- --:--:-- --:--:-- 5833k
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 1.2143e-05
go_gc_duration_seconds{quantile="0.25"} 2.9441e-05
go_gc_duration_seconds{quantile="0.5"} 9.6832e-05
go_gc_duration_seconds{quantile="0.75"} 0.000199094
go_gc_duration_seconds{quantile="1"} 0.000424251
go_gc_duration_seconds_sum 0.000761761
go_gc_duration_seconds_count 5
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 38
# HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.12.4"} 1
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes 1.385236e+07
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
# TYPE go_memstats_alloc_bytes_total counter
[root@yj26-ovstest3 ~]#
Metric name
Label
Time series
go_gc_duration_seconds의
Cardinality는 7
Metric Type
Description of metric
16. 02. Usage
• PromQL
Internal Fuction
Time series name
Selector
Range
Sample
Instant vector
Access URL
Metric name
kvm2 를 제외한 node의 eth0에서
3분동안 수신한 traffic byte 총량의
1초당 평균 변화량 = Network 사용률
31. 05. Performance
• Hardware
⚫ 1개의 Sample을 압축 하면 약 1.3 bytes 정도의 storage 소모
⚫ 기본설정 15일간의 data를 남기고 초당 10만 sample을 저장한다고 한다면 Storag
e 약 240GB 정도 소모
⚫ 초당 10만 sample정도 처리하는데 CPU 약 0.25개 정도 소모.
⚫ Query, Recording rule, Go gabege collection 까지 생각하면 +1 개
⚫ CPU는 1.25개면 충분!
⚫ 초당 10만 sample정도에 Memory는 약 8GB면 충분.
⚫ Prometheus는 scrap 시 압축을 해서 받기에 1개의 sample당 Network ba
ndwidth 20 bytes 정도 소모
⚫ 초당 10만 sample을 처리하는데 Network bandwidth는 약 16Mbps 소
모.
Node exporter 1개 약 3000 Time series
Node 100대
기본 15초에 1번씩 scrap
= 20000/s