Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Practical Guide to Prometheus for App Developers

A Practical Guide to Prometheus for App Developers

I've presented this deck at Docker meetup in San Francisco.

See https://github.com/errordeveloper/prom-nodejs-demo/blob/v0-start/README.DOCKER.md for instructions.

121dcfb4f05ed316247772545e2cd590?s=128

Ilya Dmitrichenko

October 11, 2017
Tweet

Transcript

  1. @errordeveloper A Practical Guide to Prometheus for App Developers

  2. outline: – theory – tutorial

  3. Prometheus PromQL and alerts MyApp Prometheus GET /metrics remote_write Deploy

    App to Docker Swarm
  4. Prometheus: what is it?

  5. Prometheus: how it works?

  6. Prometheus: say more?

  7. > 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
  8. > 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
  9. process_uptime_seconds

  10. process_uptime_seconds{job=“myapp”}

  11. http_requests_duration_seconds_count

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

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

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

  15. up

  16. up{job=“myapp"}

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

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

  19. cloud.weave.works

  20. ilya@weave.works slack.weave.works