Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Globalcode – Open4education
Instrumenting Go applications with Prometheus
André Carvalho / @andresantostc
globo.com / tsur...
Globalcode – Open4education
André Carvalho
Developer @ globo.com
Open Source
tsuru maintainer
other contributions
2
Globalcode – Open4education
Agenda
Intro
Motivation
Instrumentation
Prometheus
Demo
3
Globalcode – Open4education
4
Why?
Service
Globalcode – Open4education
5
Why?
Service
Users
Globalcode – Open4education
6
Why?
Service
Users
Dependencies
Globalcode – Open4education
7
Why?
Service
Users
Dependencies
Your service is slow!
Globalcode – Open4education
8
Why?
Service
Users
Dependencies
Your service is slow!
Is the problem here?
Globalcode – Open4education
9
Why?
Service
Users
Dependencies
Your service is slow!
Or here?
Globalcode – Open4education
10
Why?
Service
Users
Dependencies
Your service is slow!
Maybe here?
Globalcode – Open4education
11
Why?
Service
Users
Dependencies
Your service is slow!
It has to be here! Or not…
Globalcode – Open4education
Ability to monitor or
measure the level
of a product's
performance, to
diagnose errors
and to ...
Globalcode – Open4education
How & what?
USE
Brendan Gregg
Utilization
Saturation
Error rate
RED
Tom Wilkie
Request rate
Er...
Globalcode – Open4education
14
Prometheus
Globalcode – Open4education
Prometheus
Monitoring and Alerting system (https://
prometheus.io/)
Created by SoundCloud
Writ...
Globalcode – Open4education
Prometheus
Pull based (HTTP)
Easier to maintain and scale
Flexible query language
Service disc...
Globalcode – Open4education
Prometheus
17
Globalcode – Open4education
connections_current_open{instance="192.168.50.10:9080",job="router"} 165
Prometheus Metrics
18
Globalcode – Open4education
connections_current_open{instance="192.168.50.10:9080",job="router"} 165
Name
Prometheus Metri...
Globalcode – Open4education
connections_current_open{instance="192.168.50.10:9080",job="router"} 165
Labels
Prometheus Met...
Globalcode – Open4education
connections_current_open{instance="192.168.50.10:9080",job="router"} 165
Value
Prometheus Metr...
Globalcode – Open4education
Go, Prometheus!
Official client
https://github.com/prometheus/client_golang
Out of the box run...
Globalcode – Open4education
github.com/andrestc/demo-go-instrument
Demo
23
Globalcode – Open4education
24
GET /city/{name}/temp
Redis
api.openweathermap.org
Queue
Demo
localhost:8080
Globalcode – Open4education
25
Redis
api.openweathermap.org
USE
RED
RED
Utilization
Saturation
Error rate
Request rate
Err...
Globalcode – Open4education
Demo
26
Globalcode – Open4education
Obrigado!
github.com/andrestc


@andresantostc


27
Upcoming SlideShare
Loading in …5
×

Instrumenting Go applications with Prometheus

861 views

Published on

Go code instrumentation with Prometheus.

Published in: Software
  • Be the first to comment

Instrumenting Go applications with Prometheus

  1. 1. Globalcode – Open4education Instrumenting Go applications with Prometheus André Carvalho / @andresantostc globo.com / tsuru.io 1
  2. 2. Globalcode – Open4education André Carvalho Developer @ globo.com Open Source tsuru maintainer other contributions 2
  3. 3. Globalcode – Open4education Agenda Intro Motivation Instrumentation Prometheus Demo 3
  4. 4. Globalcode – Open4education 4 Why? Service
  5. 5. Globalcode – Open4education 5 Why? Service Users
  6. 6. Globalcode – Open4education 6 Why? Service Users Dependencies
  7. 7. Globalcode – Open4education 7 Why? Service Users Dependencies Your service is slow!
  8. 8. Globalcode – Open4education 8 Why? Service Users Dependencies Your service is slow! Is the problem here?
  9. 9. Globalcode – Open4education 9 Why? Service Users Dependencies Your service is slow! Or here?
  10. 10. Globalcode – Open4education 10 Why? Service Users Dependencies Your service is slow! Maybe here?
  11. 11. Globalcode – Open4education 11 Why? Service Users Dependencies Your service is slow! It has to be here! Or not…
  12. 12. Globalcode – Open4education Ability to monitor or measure the level of a product's performance, to diagnose errors and to write trace information. 12 Instrumentation
  13. 13. Globalcode – Open4education How & what? USE Brendan Gregg Utilization Saturation Error rate RED Tom Wilkie Request rate Error rate Duration 13
  14. 14. Globalcode – Open4education 14 Prometheus
  15. 15. Globalcode – Open4education Prometheus Monitoring and Alerting system (https:// prometheus.io/) Created by SoundCloud Written in Go Open Source Member of the Cloud Native Computing Foundation 15
  16. 16. Globalcode – Open4education Prometheus Pull based (HTTP) Easier to maintain and scale Flexible query language Service discovery Kubernetes, AWS, Azure, Consul, … Several exporters already available Node, JMX, Mysqld, … Easy to build your own! 16
  17. 17. Globalcode – Open4education Prometheus 17
  18. 18. Globalcode – Open4education connections_current_open{instance="192.168.50.10:9080",job="router"} 165 Prometheus Metrics 18
  19. 19. Globalcode – Open4education connections_current_open{instance="192.168.50.10:9080",job="router"} 165 Name Prometheus Metrics 19
  20. 20. Globalcode – Open4education connections_current_open{instance="192.168.50.10:9080",job="router"} 165 Labels Prometheus Metrics 20
  21. 21. Globalcode – Open4education connections_current_open{instance="192.168.50.10:9080",job="router"} 165 Value Prometheus Metrics 21
  22. 22. Globalcode – Open4education Go, Prometheus! Official client https://github.com/prometheus/client_golang Out of the box runtime metrics Goroutines, GC latency, OS threads Supported metrics Counter, Gauge, Histogram and Summary prometheus.Collector interface 22
  23. 23. Globalcode – Open4education github.com/andrestc/demo-go-instrument Demo 23
  24. 24. Globalcode – Open4education 24 GET /city/{name}/temp Redis api.openweathermap.org Queue Demo localhost:8080
  25. 25. Globalcode – Open4education 25 Redis api.openweathermap.org USE RED RED Utilization Saturation Error rate Request rate Error rate Duration Demo GET /city/{name}/temp localhost:8080
  26. 26. Globalcode – Open4education Demo 26
  27. 27. Globalcode – Open4education Obrigado! github.com/andrestc 
 @andresantostc 
 27

×