Instrumenting Go applications with Prometheus

André Carvalho
André CarvalhoSoftware Engineer at Globo.com
Globalcode – Open4education
Instrumenting Go applications with Prometheus
André Carvalho / @andresantostc
globo.com / tsuru.io
1
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 write trace
information.
12
Instrumentation
Globalcode – Open4education
How & what?
USE
Brendan Gregg
Utilization
Saturation
Error rate
RED
Tom Wilkie
Request rate
Error rate
Duration
13
Globalcode – Open4education
14
Prometheus
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
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
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 Metrics
19
Globalcode – Open4education
connections_current_open{instance="192.168.50.10:9080",job="router"} 165
Labels
Prometheus Metrics
20
Globalcode – Open4education
connections_current_open{instance="192.168.50.10:9080",job="router"} 165
Value
Prometheus Metrics
21
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
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
Error rate
Duration
Demo
GET /city/{name}/temp
localhost:8080
Globalcode – Open4education
Demo
26
Globalcode – Open4education
Obrigado!
github.com/andrestc


@andresantostc


27
1 of 27

Recommended

Global Companies Adopting Quality Globalisation by
Global Companies Adopting Quality GlobalisationGlobal Companies Adopting Quality Globalisation
Global Companies Adopting Quality GlobalisationGary Lefman
219 views13 slides
5 Reasons to attend iqnite 2014 Conference by
5 Reasons to attend iqnite 2014 Conference5 Reasons to attend iqnite 2014 Conference
5 Reasons to attend iqnite 2014 ConferenceKJR
426 views12 slides
Leading the Transformation: Stories from the Trenches by
Leading the Transformation: Stories from the TrenchesLeading the Transformation: Stories from the Trenches
Leading the Transformation: Stories from the TrenchesDevOps.com
211 views12 slides
The Cloud: Releasing Software into Controlled Chaos - GHC by
The Cloud: Releasing Software into Controlled Chaos - GHCThe Cloud: Releasing Software into Controlled Chaos - GHC
The Cloud: Releasing Software into Controlled Chaos - GHCGeraldine Gray
358 views7 slides
Automated Hand Sanitizer Device For Supermarket Entrance by
Automated Hand Sanitizer Device For Supermarket EntranceAutomated Hand Sanitizer Device For Supermarket Entrance
Automated Hand Sanitizer Device For Supermarket EntranceDilushaMunasinghe
29 views16 slides
Go Execution Tracer by
Go Execution TracerGo Execution Tracer
Go Execution TracerAndré Carvalho
1.2K views36 slides

More Related Content

Similar to Instrumenting Go applications with Prometheus

HPE | Network Virtualization | POC by
HPE | Network Virtualization | POCHPE | Network Virtualization | POC
HPE | Network Virtualization | POCJeffrey Nunn
633 views57 slides
Introduce Test Harness for Direct To Consumer Solutions.pdf by
Introduce Test Harness for Direct To Consumer Solutions.pdfIntroduce Test Harness for Direct To Consumer Solutions.pdf
Introduce Test Harness for Direct To Consumer Solutions.pdfKnoldus Inc.
29 views23 slides
DevOps Deconstructed by
DevOps DeconstructedDevOps Deconstructed
DevOps DeconstructedJeremy Pullen
115 views48 slides
Software Testing - Online Guide by
Software Testing - Online GuideSoftware Testing - Online Guide
Software Testing - Online Guidebigspire
659 views90 slides
Il paradigma DevOps e Continuous Delivery Automation by
Il paradigma DevOps e Continuous Delivery AutomationIl paradigma DevOps e Continuous Delivery Automation
Il paradigma DevOps e Continuous Delivery AutomationHP Enterprise Italia
641 views9 slides
OpenControl Overview - Joshua McKenty by
OpenControl Overview - Joshua McKentyOpenControl Overview - Joshua McKenty
OpenControl Overview - Joshua McKentyJulie Coonce
367 views17 slides

Similar to Instrumenting Go applications with Prometheus(20)

HPE | Network Virtualization | POC by Jeffrey Nunn
HPE | Network Virtualization | POCHPE | Network Virtualization | POC
HPE | Network Virtualization | POC
Jeffrey Nunn633 views
Introduce Test Harness for Direct To Consumer Solutions.pdf by Knoldus Inc.
Introduce Test Harness for Direct To Consumer Solutions.pdfIntroduce Test Harness for Direct To Consumer Solutions.pdf
Introduce Test Harness for Direct To Consumer Solutions.pdf
Knoldus Inc.29 views
Software Testing - Online Guide by bigspire
Software Testing - Online GuideSoftware Testing - Online Guide
Software Testing - Online Guide
bigspire659 views
Il paradigma DevOps e Continuous Delivery Automation by HP Enterprise Italia
Il paradigma DevOps e Continuous Delivery AutomationIl paradigma DevOps e Continuous Delivery Automation
Il paradigma DevOps e Continuous Delivery Automation
OpenControl Overview - Joshua McKenty by Julie Coonce
OpenControl Overview - Joshua McKentyOpenControl Overview - Joshua McKenty
OpenControl Overview - Joshua McKenty
Julie Coonce367 views
Tales from the Postgres Front - and What We Can Learn by EDB
Tales from the Postgres Front - and What We Can LearnTales from the Postgres Front - and What We Can Learn
Tales from the Postgres Front - and What We Can Learn
EDB674 views
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ... by tdc-globalcode
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
tdc-globalcode168 views
Qualcomm Life Connect 2013: On Boarding and Customer Support by Qualcomm Life
Qualcomm Life Connect 2013: On Boarding and Customer SupportQualcomm Life Connect 2013: On Boarding and Customer Support
Qualcomm Life Connect 2013: On Boarding and Customer Support
Qualcomm Life1.5K views
SolarWinds Product Management Technical Drilldown on Deep Packet Inspection a... by SolarWinds
SolarWinds Product Management Technical Drilldown on Deep Packet Inspection a...SolarWinds Product Management Technical Drilldown on Deep Packet Inspection a...
SolarWinds Product Management Technical Drilldown on Deep Packet Inspection a...
SolarWinds1.4K views
Understanding DevOps in simpler way with Continuous Delivery by Swapnil Jain
Understanding DevOps in simpler way with Continuous DeliveryUnderstanding DevOps in simpler way with Continuous Delivery
Understanding DevOps in simpler way with Continuous Delivery
Swapnil Jain1.1K views
Technology and Digital Platform | 2019 partner summit by Andrew Kumar
Technology and Digital Platform | 2019 partner summitTechnology and Digital Platform | 2019 partner summit
Technology and Digital Platform | 2019 partner summit
Andrew Kumar613 views
Migrations, Health Checks, and Support Experiences - Postgres from the Servic... by EDB
Migrations, Health Checks, and Support Experiences - Postgres from the Servic...Migrations, Health Checks, and Support Experiences - Postgres from the Servic...
Migrations, Health Checks, and Support Experiences - Postgres from the Servic...
EDB1.3K views
stackconf 2023 | Measuring Reliability in Production by Thomas Voss.pdf by NETWAYS
stackconf 2023 | Measuring Reliability in Production by Thomas Voss.pdfstackconf 2023 | Measuring Reliability in Production by Thomas Voss.pdf
stackconf 2023 | Measuring Reliability in Production by Thomas Voss.pdf
NETWAYS18 views
SpiraTest Overview Presentation (2022) by Inflectra
SpiraTest Overview Presentation (2022)SpiraTest Overview Presentation (2022)
SpiraTest Overview Presentation (2022)
Inflectra918 views
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro... by Bruno Tanoue
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
Bruno Tanoue795 views

More from André Carvalho

Containers na Globo.com - Passado, Presente e Futuro by
Containers na Globo.com - Passado, Presente e FuturoContainers na Globo.com - Passado, Presente e Futuro
Containers na Globo.com - Passado, Presente e FuturoAndré Carvalho
819 views93 slides
Tsuru - Deploys Fáceis e Seguros by
Tsuru - Deploys Fáceis e SegurosTsuru - Deploys Fáceis e Seguros
Tsuru - Deploys Fáceis e SegurosAndré Carvalho
447 views28 slides
Classificação de séries temporais via divergente entre densidades de probabil... by
Classificação de séries temporais via divergente entre densidades de probabil...Classificação de séries temporais via divergente entre densidades de probabil...
Classificação de séries temporais via divergente entre densidades de probabil...André Carvalho
236 views67 slides
Instrumentando aplicações Go com Prometheus by
Instrumentando aplicações Go com PrometheusInstrumentando aplicações Go com Prometheus
Instrumentando aplicações Go com PrometheusAndré Carvalho
294 views13 slides
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ... by
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...André Carvalho
1.1K views39 slides
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG... by
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...André Carvalho
473 views26 slides

More from André Carvalho(7)

Containers na Globo.com - Passado, Presente e Futuro by André Carvalho
Containers na Globo.com - Passado, Presente e FuturoContainers na Globo.com - Passado, Presente e Futuro
Containers na Globo.com - Passado, Presente e Futuro
André Carvalho819 views
Tsuru - Deploys Fáceis e Seguros by André Carvalho
Tsuru - Deploys Fáceis e SegurosTsuru - Deploys Fáceis e Seguros
Tsuru - Deploys Fáceis e Seguros
André Carvalho447 views
Classificação de séries temporais via divergente entre densidades de probabil... by André Carvalho
Classificação de séries temporais via divergente entre densidades de probabil...Classificação de séries temporais via divergente entre densidades de probabil...
Classificação de séries temporais via divergente entre densidades de probabil...
André Carvalho236 views
Instrumentando aplicações Go com Prometheus by André Carvalho
Instrumentando aplicações Go com PrometheusInstrumentando aplicações Go com Prometheus
Instrumentando aplicações Go com Prometheus
André Carvalho294 views
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ... by André Carvalho
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...
André Carvalho1.1K views
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG... by André Carvalho
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...
André Carvalho473 views
Clusterização de padrões de candlesticks utilizando Mapas de Kohonen by André Carvalho
Clusterização de padrões de candlesticks utilizando Mapas de KohonenClusterização de padrões de candlesticks utilizando Mapas de Kohonen
Clusterização de padrões de candlesticks utilizando Mapas de Kohonen
André Carvalho645 views

Recently uploaded

Dapr Unleashed: Accelerating Microservice Development by
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice DevelopmentMiroslav Janeski
15 views29 slides
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation by
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationDRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationHCLSoftware
6 views8 slides
Top-5-production-devconMunich-2023.pptx by
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTier1 app
9 views40 slides
360 graden fabriek by
360 graden fabriek360 graden fabriek
360 graden fabriekinfo33492
165 views25 slides
Introduction to Gradle by
Introduction to GradleIntroduction to Gradle
Introduction to GradleJohn Valentino
6 views7 slides
Flask-Python.pptx by
Flask-Python.pptxFlask-Python.pptx
Flask-Python.pptxTriloki Gupta
9 views12 slides

Recently uploaded(20)

Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski15 views
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation by HCLSoftware
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationDRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
HCLSoftware6 views
Top-5-production-devconMunich-2023.pptx by Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app9 views
360 graden fabriek by info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492165 views
Top-5-production-devconMunich-2023-v2.pptx by Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app8 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino7 views
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... by TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin96 views
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi216 views
predicting-m3-devopsconMunich-2023-v2.pptx by Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app12 views
Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
How to build dyanmic dashboards and ensure they always work by Wiiisdom
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always work
Wiiisdom14 views

Instrumenting Go applications with Prometheus