Agile Lean Ireland - Workshop - Cloud native monitoring with prometheus

Pierre Vincent
Pierre VincentInfrastructure & Reliability Manager at Poppulo
Cloud Native Monitoring
with
Prometheus & Grafana
April 26th, 2019 – Dublin
@PierreVincent pvincent.io
@PierreVincent
Reaching production is
only the beginning
Pierre Vincent
Infrastructure & Reliability Manager
@PierreVincent
pvincent.io
@PierreVincent
Workshop Overview
Slides - Metrics & Prometheus basics
Part 1 - Intro to Prometheus UI and Queries
Part 2 - Building Grafana Dashboards
Part 3 - Creating Prometheus Alerts
Part 4 - Instrumenting Code (Golang)
@PierreVincent
System
metrics
Application
metrics
Business
metrics
CPU usage Error rates Customer conversions
Metrics
@PierreVincent
“Cloud Native” changes the game
Monolithic architectures
Long-running instances
Long-running servers
Loosely-coupled architectures
Short-lived instances
Short/Medium-lived servers
Microservices
Auto-scaling
deployments
Multiple
deploys/day
Cloud VMsAuto-scaling
clusters
SOA
@PierreVincent
Servers / VMs
Appliances/Infra
Services
/metrics
/metrics
/metrics
Prometheus
Overview
@PierreVincent
Scraping for samples
User
Service
/metrics
# HELP http_requests_total Total number of http requests
by response status code
# TYPE http_requests_total counter
http_requests_total{endpoint="/login",status="200"} 1584
http_requests_total{endpoint="/login",status="500"} 9
...
metric
http_requests_total
labels
endpoint=/login
status=200
timestamp
1519205931
value
1584
tsdb
Each value
results in a
sample
Every scrape
interval
Persist
@PierreVincent
Our example
http-simulator
/metrics
http_requests_total
http_request_duration_milliseconds
+ standard go metrics
Option 1: Deploy on your own cluster
See instructions in kubernetes/install
Option 2: Use pre-deployed setup
prometheus.prom-workshop.pvincent.io
grafana.prom-workshop.pvincent.io
OR
http://grafana.prom-workshop.pvincent.io
PierreVincent/prometheus-workshop
http://prometheus.prom-workshop.pvincent.io
@PierreVincent
Exercises 1 - Counters & Rates
● What's the overall request rate (with a 1 minute rolling-window) for the http-
simulator service?
● How many requests per minute are errors?
● What's the error rate (in %) of requests to the /users endpoint?
sum(rate(http_requests_total{app="http-simulator"}[1m]))
60*sum(rate(http_requests_total{app="http-simulator",
status="500"}[1m]))
100 * sum(rate(http_requests_total{app="http-simulator",
endpoint="/users", status="500"}[1m])) /
sum(rate(http_requests_total{app="http-simulator",
endpoint="/users"}[1m]))
@PierreVincent
Exercises 2 - Latency distribution
● What is the median latency of all requests to the http-simulator service?
● Does the /users endpoint fulfill the SLO of 3 Nines requests responding within
400ms?
histogram_quantile(0.5,rate(http_request_duration_milliseconds_
bucket{app="http-simulator"}[5m]))
sum(http_request_duration_milliseconds_bucket{app="http-
simulator", status="200", endpoint="/users", le="400"}) /
sum(http_request_duration_milliseconds_count{app="http-
simulator", status="200", endpoint="/users"})
@PierreVincent
Exercises 3 - Grafana widgets
Some examples of widgets (or come up with your own ones):
● Graph of latency distribution
● Cumulative % graph of endpoint request rate
● Memory usage over time
● CPU usage over time
● Graph % of requests fulfilling the SLO of 400ms for /login endpoint
● ...
1 of 13

More Related Content

Featured(20)

How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC4.1K views
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy82.1K views
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani30.3K views
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking6.9K views
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
I Rock Therefore I Am. 20 Legendary Quotes from PrinceI Rock Therefore I Am. 20 Legendary Quotes from Prince
I Rock Therefore I Am. 20 Legendary Quotes from Prince
Empowered Presentations142.8K views
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views

Agile Lean Ireland - Workshop - Cloud native monitoring with prometheus