Course: Prometheus | The Complete Hands-On for Monitoring & Alerting udemy.com/course/prometheus-course

Architecture

prometheus pulls metrics ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/c1mgt0kamsfpwvou.png discovery: hardcoded or service discovery ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/zzn9brsszasyokln.png

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/1dpdi7pgjeclhgoi.png

UI

localhost:9090 up - targets scraped by prometheus ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/wxhlbxhj17qzw2up.png

config file

prometheus.yml ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/5r3uigpcxnjmcsa2.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/chy6ckbkqlr4dtum.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/k9eyopdmrm3bdk16.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/xihcbnwpqg7oddd4.png Plain Text metric_name{key_name=“value”, key=“value”} metric_value

Exporters

get metrics from third-party systems ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/2adobdamukxuawrv.png

TODO: PromQL

client libs

prometheus official ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/t2r5ga52ruu5tnrx.png community ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/yflzzs42tgzmbxgk.png

metric types

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/xwltn0eg0llf19em.png

counter - up / restarted service

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/gdlwkflvwxmho6oa.png

gauge - up an down

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/2an47nswvbg6hyms.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/lqxfikfsywwanxob.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/lhytduwjrnm0ncu3.png

<name>


app_requests_inprogress

summary - samples

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/ixw4gwphspednhpa.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/gkzrpblokgtedtc7.png

<name>_count
<name>_sum


rate(app_Response_latency_seconds_sum[5m]) / rate(app_Response_latency_seconds_count[5m])

histogram - samples in buckets

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/26poekwpors4byoj.png ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/jeectqaefi3dx5bc.png

<name>_bucket{le="..."}
<name>_bucket{le="..."}
<name>_bucket{le="..."}
<name>_count
<name>_sum



# le = less then or equal to
# -> every request will be in +Inf bucket

Recording rules

./resources/course-prometheus-the-complete-hands-on-for-monito.resources/dpgairwkwu9uk2lv.png recording rules - pre-cached stores new time series of the calculated values ./resources/course-prometheus-the-complete-hands-on-for-monito.resources/aa5fejqhlprk3bu7.png