Slide 1

Slide 1 text

@errordeveloper A Practical Guide to Prometheus for App Developers

Slide 2

Slide 2 text

outline: – theory – tutorial

Slide 3

Slide 3 text

Prometheus PromQL and alerts MyApp Prometheus GET /metrics remote_write Deploy App to Docker Swarm

Slide 4

Slide 4 text

Prometheus: what is it?

Slide 5

Slide 5 text

Prometheus: how it works?

Slide 6

Slide 6 text

Prometheus: say more?

Slide 7

Slide 7 text

> curl http://localhost:8080/metrics ... # HELP process_starttime_seconds The starttime of the Java virtual machine # TYPE process_starttime_seconds gauge process_starttime_seconds 1.506735317456E9 # HELP process_uptime_seconds The uptime of the Java virtual machine # TYPE process_uptime_seconds gauge process_uptime_seconds 145236.015

Slide 8

Slide 8 text

> curl http://localhost:8080/metrics ... # HELP http_requests_duration_seconds Timer of servlet request # TYPE http_requests_duration_seconds summary http_requests_duration_seconds_count{method="GET",status=" 200",uri="/"} 2.0 http_requests_duration_seconds_sum{method="GET",status="20 0",uri="/"} 0.05230485

Slide 9

Slide 9 text

process_uptime_seconds

Slide 10

Slide 10 text

process_uptime_seconds{job=“myapp”}

Slide 11

Slide 11 text

http_requests_duration_seconds_count

Slide 12

Slide 12 text

http_requests_duration_seconds_count{ job=“myapp”, method=“GET”, uri=“/”, }

Slide 13

Slide 13 text

sum( http_requests_duration_seconds_count{ job=“myapp”, method=“GET”, uri=“/”, } )

Slide 14

Slide 14 text

sum( rate( http_requests_duration_seconds_count{ job=“myapp”, method=“GET”, uri=“/”, }[1m] ) )

Slide 15

Slide 15 text

up

Slide 16

Slide 16 text

up{job=“myapp"}

Slide 17

Slide 17 text

sum( up{job=“myapp"} ) by (job)

Slide 18

Slide 18 text

tutorial: step-by-step guide to Prometheus with Node.js http://github.com/errordeveloper/prom-nodejs-demo

Slide 19

Slide 19 text

cloud.weave.works

Slide 20

Slide 20 text

[email protected] slack.weave.works