SlideShare a Scribd company logo
Scraping metrics for fun and profit
Bram Vogelaar
@attachmentgenie
Confidential and Proprietary
~ ❯ whoami
• Used to be a Molecular Biologist
• Then became a Dev, now an Ops
• Currently Cloud Engineer @ Seaplane.io
• Amsterdam HUG organizer
• Author of soon to be released LGTM book
Confidential and Proprietary
Confidential and Proprietary
Can you honestly answer this question?
Can you figure out if your
platform is in an error
state?
Confidential and Proprietary
Large complex systems will always be in a (somewhat)
degraded state
Confidential and Proprietary
3 pillars of observability
Confidential and Proprietary
3 pillars of observability
Metrics
Logs
Traces
Confidential and Proprietary
Metrics
● Open-Source tool to do metrics collection and storage
● Since 2012/2015, by SoundCloud
● CNCF graduated project
● HTTP pull model
● PromQL DSL
https://prometheus.io/
Confidential and Proprietary
Metrics Ecosystem
Confidential and Proprietary
Viewing (Node Exporter) Metrics
Confidential and Proprietary
BYOD exporter / Beg, borrow, steal
https://prometheus.io/docs/instrumenting/exporters/
Confidential and Proprietary
Prometheus Configuration
global:
scrape_interval: 15s
scrape_configs:
- job_name: o11y
static_configs:
- targets:
- localhost:9100
- localhost:3100
- localhost:3200
Confidential and Proprietary
Prometheus/Metrics HA,
Dynamic Scraping
global:
scrape_interval: 10s
scrape_configs:
- job_name: o11y
static_configs:
- targets:
- localhost:9100
- localhost:3100
- localhost:3200
- job_name: o11y
scrape_interval: 10s
consul_sd_configs:
- server: localhost:8500
tags:
- metrics
Confidential and Proprietary
Write your own exporter
package main
import (
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(":2112", nil)
}
Confidential and Proprietary
Write your own exporter
var pingCounter = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "ping_request_count",
Help: "No of request handled by Ping handler",
},
)
func ping(w http.ResponseWriter, req *http.Request) {
pingCounter.Inc()
fmt.Fprintf(w, "pong")
}
func main() {
prometheus.MustRegister(pingCounter)
…
Confidential and Proprietary
Write your own exporter
Confidential and Proprietary
Forcing labels / Decorating metrics
global:
scrape_interval: 10s
external_labels:
datacenter: "%{::trusted.extensions.pp_datacenter}"
region: "%{::trusted.extensions.pp_region}" <- use ${IATA_CODES}
env: "%{::trusted.extensions.pp_environment}"
Confidential and Proprietary
PromQL
http_requests_total{job=”nginx", handler="/grafana"}[5m]
sum by (job) ( rate(http_requests_total[5m]) )
sum by (region) (bird_protocol_up{ip_version="ipv4",proto="BGP",env="$environment"})
https://prometheus.io/docs/prometheus/latest/querying/basics/
Confidential and Proprietary
Tensegrity of observability
Metrics
Logs
Traces
Alerts
Dashboards
Confidential and Proprietary
Dashboards
● Grafana is a multi-platform open source analytics and
interactive visualization web application
● Since 2014, by Torkel Ödegaard
https://grafana.com/oss
/grafana/
Confidential and Proprietary
Confidential and Proprietary
Zooming to what you need to see
Confidential and Proprietary
What is going on here?
Confidential and Proprietary
Annotate Graphs
Confidential and Proprietary
Correlate metrics with events
Confidential and Proprietary
Data should tell beautiful stories
https://www.youtube.com/watch?v=hVimVzgtD6w
https://www.youtube.com/watch?v=jbkSRLYSojo
Confidential and Proprietary
Data should tell beautiful stories
Confidential and Proprietary
Canvas Plugin
Confidential and Proprietary
Correlate events with metrics
Confidential and Proprietary
Instrument data flows
Confidential and Proprietary
Correlate events with metrics
Marketing Campaign
ON
Confidential and Proprietary
Don’t stare at dashboards
Confidential and Proprietary
Alerts are PromQL queries too
- alert: PrometheusJobMissing
expr: absent(up{job="prometheus"})
for: 0m
labels:
severity: warning
annotations:
summary: Prometheus job missing (instance {{ $labels.instance }})
description: "A Prometheus job has disappearedn VALUE = {{ $value }}n LABELS = {{ $labels
}}"
https://awesome-prometheus-alerts.grep.to/
Confidential and Proprietary
R.E.D & U.S.E
U = Utilization, as canonically defined
S = Concurrency
E = Error Rate, as a throughput metric
R = Request Throughput, in requests per second
E = Request Error Rate, as either a throughput metric or a
fraction of overall throughput
D = Latency, Residence Time, or Response Time; all three are
widely used
Confidential and Proprietary
Instrumentation
Confidential and Proprietary
What we need to visualize
$/€ revenue
# of sales
# of signups
# of Api calls
“(Ab)Normal” application use
Confidential and Proprietary
SL{O,I,A}
Service-Level Agreement (SLA) => Contract
Service-Level Objective (SLO) => Wish/Hope
Service-Level Indicator (SLI) => Observe
Confidential and Proprietary
Only alert on SLO violation
And definitely on HDD space usage
Don’t alert on symptoms
Do alert on the rate you are using the error budget
Questions Before Takeoff?
bram@attachmentgenie.com
@attachmentgenie
https://www.slideshare.net/attachmentgenie

More Related Content

PPTX
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
PDF
H2o.ai presentation at 2nd Virtual Pydata Piraeus meetup
PDF
RubiOne: Apache Spark as the Backbone of a Retail Analytics Development Envir...
PPTX
Seldon @ PAPIs Connect, Valencia, 2016-03-14
PDF
The Complexity to "Yes" in Analytics Software and the Possibilities with Dock...
PPTX
Data Ops at TripActions
PDF
Making machine learning model deployment boring - Big Data Expo 2019
PDF
Developing cloud serverless components in Python: DDD Perspective
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
H2o.ai presentation at 2nd Virtual Pydata Piraeus meetup
RubiOne: Apache Spark as the Backbone of a Retail Analytics Development Envir...
Seldon @ PAPIs Connect, Valencia, 2016-03-14
The Complexity to "Yes" in Analytics Software and the Possibilities with Dock...
Data Ops at TripActions
Making machine learning model deployment boring - Big Data Expo 2019
Developing cloud serverless components in Python: DDD Perspective

Similar to Scraping metrics for fun and profit (20)

PDF
[AIIM16] Success through Pragmatism: Moving from Hell to Purgatory Is a Win.
PPTX
Vitalii Bondarenko and Eugene Berko "Cloud AI Platform as an accelerator of e...
PPTX
Evolve13 Adobe CQ Conference - Life Technologies and Cloudwords Customer Story
PDF
Cloud-native Patterns (July 4th, 2019)
PDF
Cloud-native Patterns
PPTX
Smarter Experimentation with Fully Integrated Data
PPTX
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
PDF
Continuous delivery for machine learning
PDF
Presumption of Abundance: Architecting the Future of Success
PPTX
Google Developers Overview Deck 2015
PPTX
From Data Science to MLOps
PDF
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
PPTX
Using Event Streams in Serverless Applications
PPT
Osgis2011 edina addy_pope
PPT
Osgis2011 edina addy_pope
PPTX
EVOLVE'13 | Customer Success Story | Life Technologies | Blair Hardie
PDF
Partner Connect APAC - 2022 - April
PPTX
Building a Real-Time Security Application Using Log Data and Machine Learning...
PDF
Data Science in Production: Technologies That Drive Adoption of Data Science ...
PDF
ML Model Deployment and Scoring on the Edge with Automatic ML & DF
[AIIM16] Success through Pragmatism: Moving from Hell to Purgatory Is a Win.
Vitalii Bondarenko and Eugene Berko "Cloud AI Platform as an accelerator of e...
Evolve13 Adobe CQ Conference - Life Technologies and Cloudwords Customer Story
Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns
Smarter Experimentation with Fully Integrated Data
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Continuous delivery for machine learning
Presumption of Abundance: Architecting the Future of Success
Google Developers Overview Deck 2015
From Data Science to MLOps
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
Using Event Streams in Serverless Applications
Osgis2011 edina addy_pope
Osgis2011 edina addy_pope
EVOLVE'13 | Customer Success Story | Life Technologies | Blair Hardie
Partner Connect APAC - 2022 - April
Building a Real-Time Security Application Using Log Data and Machine Learning...
Data Science in Production: Technologies That Drive Adoption of Data Science ...
ML Model Deployment and Scoring on the Edge with Automatic ML & DF
Ad

More from Bram Vogelaar (20)

PPTX
Terraforming your Platform Engineering organisation.pptx
PDF
Secure second days operations with Boundary and Vault.pdf
PDF
Cost reconciliation in a post CMDB world
PDF
Self scaling Multi cloud nomad workloads
PDF
10 things i learned building nomad-packs
PDF
10 things I learned building Nomad packs
PDF
Easy Cloud Native Transformation with Nomad
PDF
Uncomplicated Nomad
PDF
Observability; a gentle introduction
PDF
Running Trusted Payload with Nomad and Waypoint
PDF
Easy Cloud Native Transformation using HashiCorp Nomad
PDF
Securing Prometheus exporters using HashiCorp Vault
PDF
CICD using jenkins and Nomad
PDF
Bootstrapping multidc observability stack
PDF
Running trusted payloads with Nomad and Waypoint
PDF
Gamification of Chaos Testing
PDF
Puppet and the HashiStack
PDF
Bootstrapping multidc observability stack
PPTX
Creating Reusable Puppet Profiles
PDF
Gamification of Chaos Testing
Terraforming your Platform Engineering organisation.pptx
Secure second days operations with Boundary and Vault.pdf
Cost reconciliation in a post CMDB world
Self scaling Multi cloud nomad workloads
10 things i learned building nomad-packs
10 things I learned building Nomad packs
Easy Cloud Native Transformation with Nomad
Uncomplicated Nomad
Observability; a gentle introduction
Running Trusted Payload with Nomad and Waypoint
Easy Cloud Native Transformation using HashiCorp Nomad
Securing Prometheus exporters using HashiCorp Vault
CICD using jenkins and Nomad
Bootstrapping multidc observability stack
Running trusted payloads with Nomad and Waypoint
Gamification of Chaos Testing
Puppet and the HashiStack
Bootstrapping multidc observability stack
Creating Reusable Puppet Profiles
Gamification of Chaos Testing
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
cuic standard and advanced reporting.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25 Week I
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
cuic standard and advanced reporting.pdf
Modernizing your data center with Dell and AMD
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation theory and applications.pdf

Scraping metrics for fun and profit