SlideShare a Scribd company logo
Monitoring Kubernetes
with Prometheus
Tobias Schmidt - ContainerDays NYC November 4, 2016
github.com/grobie - @dagrobie
github.com/grobie/prometheus-on-kubernetes
Bootkube or Minikube
Prometheus
Monitoring system and time series database
● Microservice architecture
○ Many more services than in traditional host-based monitoring
○ Short lifecycles
○ Heterogeneous workloads
● Insight
○ Detailed (instance/endpoint/version/... drilldown) and aggregated
(across a service) of everything (hardware to service)
○ Trends (act before something becomes a problem)
● Alerting
○ Symptom vs. Cause
○ Grouping, flexible silencing
Motivation
Overview
# HELP etcd_store_writes_total Total number of writes seen …
# TYPE etcd_store_writes_total counter
etcd_store_writes_total{action="compareAndDelete"} 2
etcd_store_writes_total{action="compareAndSwap"} 4016
etcd_store_writes_total{action="create"} 218
etcd_store_writes_total{action="set"} 5
count by(job)(up == 0) / count by(job)(up)
rate(etcd_store_writes_total{action="set"}[1m]))
sum without(action)(rate(etcd_store_writes_total[1m]))
Examples
# prometheus.yaml prometheus.io/docs/operating/configuration/
global:
# Settings applying to all jobs
scrape_configs:
# Define different scrape jobs
Rules_files:
# Load files specifying rules to pre-calculate expressions
# as well as alerts.
Configuration
scrape_configs:
- job_name: etcd
static_configs:
- targets: ["172.17.4.51:2379"]
- job_name: kube-components
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- # Custom filtering and label mapping
Configuration
# continued
relabel_configs:
- action: keep
source_labels: [__meta_kubernetes_service_name]
regex: "kube-(.*)-prometheus-discovery"
- action: keep
source_labels: [__meta_kubernetes_endpoint_port_name]
regex: "prometheus"
- action: replace
source_labels: [__meta_kubernetes_service_name]
target_label: job
regex: "(kube-.*)-prometheus-discovery"
Configuration
Kubernetes
Container orchestration system
● Pod
○ Group of one or more containers, share context and namespaces
○ Co-located and co-scheduled (allows for side-cars)
● Service
○ Logical set of Pods, stable access points
● Deployment
○ Declaration of the desired state (what to run, how to get there)
● Daemon / Pet / Replica sets
○ Definition of groups of pods (each node / stateful / stateless)
● ConfigMap
○ Configuration data / files (can be mounted in containers)
Domain objects
Workshop
Monitoring Kubernetes with Prometheus
git checkout 1.setup
kubectl get nodes
Running Prometheus in Kubernetes
Installation and configuration
● What we need
○ Pod specification defining how to run Prometheus
○ Load and manage configuration
○ Service specification to access Prometheus on stable IP
● Options
○ Write own pod+service+petset+... manifests
○ Kubernetes Helm chart in the making
https://github.com/kubernetes/charts/pull/151
○ CoreOS wrote an Operator managing Prometheus and its
configuration: https://github.com/coreos/kube-prometheus
https://coreos.com/blog/the-prometheus-operator.html
Running Prometheus
inside of Kubernetes
Prometheus Operator
© CoreOS https://coreos.com/blog/the-prometheus-operator.html
git checkout 2.install-prometheus
scripts/deploy
Monitoring Kubernetes infrastructure
Configuration and discovery
git checkout 3.monitor-nodes
scripts/deploy
git checkout 4.monitor-kubernetes
scripts/deploy
git checkout 5.install-grafana
scripts/deploy
Monitoring services in Kubernetes
Configuration and discovery
git checkout 6.monitor-example-app
scripts/deploy
Practical examples
Queries and dashboards
git checkout 7.add-rules
scripts/deploy
Monitoring Kubernetes with Prometheus
My Philosophy on Alerting
Rob Ewaschuk
https://docs.google.com/docu
ment/u/1/d/199PqyG3UsyXlwi
eHaqbGiWVa8eMWi8zzAn0Yfc
Apr8Q/preview
Further reading
Thank you
Tobias Schmidt - ContainerDays NYC November 4, 2016
github.com/grobie - @dagrobie

More Related Content

PDF
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Brian Brazil
 
PDF
Prometheus (Microsoft, 2016)
Brian Brazil
 
PDF
The history of Prometheus at SoundCloud
Tobias Schmidt
 
PDF
Kubernetes and Prometheus
Weaveworks
 
PDF
Monitoring a Kubernetes-backed microservice architecture with Prometheus
Fabian Reinartz
 
PDF
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
Tokuhiro Matsuno
 
PDF
Prometheus + Grafana = Awesome Monitoring
Henrique Galafassi Dalssaso
 
PDF
Prometheus casual talk1
wyukawa
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Brian Brazil
 
Prometheus (Microsoft, 2016)
Brian Brazil
 
The history of Prometheus at SoundCloud
Tobias Schmidt
 
Kubernetes and Prometheus
Weaveworks
 
Monitoring a Kubernetes-backed microservice architecture with Prometheus
Fabian Reinartz
 
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
Tokuhiro Matsuno
 
Prometheus + Grafana = Awesome Monitoring
Henrique Galafassi Dalssaso
 
Prometheus casual talk1
wyukawa
 

What's hot (20)

PPT
Monitoring using Prometheus and Grafana
Arvind Kumar G.S
 
PDF
Infrastructure & System Monitoring using Prometheus
Marco Pas
 
PPTX
Monitoring on Kubernetes using prometheus
Chandresh Pancholi
 
PDF
Prometheus – a next-gen Monitoring System
Fabian Reinartz
 
PDF
Getting Started Monitoring with Prometheus and Grafana
Syah Dwi Prihatmoko
 
PDF
Monitoring Kafka w/ Prometheus
kawamuray
 
PDF
An Introduction to Prometheus
Evgeny Shmarnev
 
PPTX
Prometheus for Monitoring Metrics (Fermilab 2018)
Brian Brazil
 
PPTX
An Introduction to Prometheus (GrafanaCon 2016)
Brian Brazil
 
PDF
Breaking Prometheus (Promcon Berlin '16)
Matthew Campbell
 
PPTX
Prometheus on AWS
Mitsuhiro Tanda
 
PDF
Monitoring Cloud Native Applications with Prometheus
Jacopo Nardiello
 
PDF
Weave Cortex: Multi-tenant, horizontally scalable Prometheus as a Service
Weaveworks
 
PPTX
Monitoring_with_Prometheus_Grafana_Tutorial
Tim Vaillancourt
 
PDF
20171027 モニタリング勉強会
Paul Traylor
 
PPTX
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Sridhar Kumar N
 
PDF
Cloud Monitoring tool Grafana
Dhrubaji Mandal ♛
 
ODP
Using Grails to power your electric car
Marco Pas
 
PDF
Prometheus Is Good for Your Small Startup - ShuttleCloud Corp. - 2016
ShuttleCloud
 
PDF
Server monitoring using grafana and prometheus
Celine George
 
Monitoring using Prometheus and Grafana
Arvind Kumar G.S
 
Infrastructure & System Monitoring using Prometheus
Marco Pas
 
Monitoring on Kubernetes using prometheus
Chandresh Pancholi
 
Prometheus – a next-gen Monitoring System
Fabian Reinartz
 
Getting Started Monitoring with Prometheus and Grafana
Syah Dwi Prihatmoko
 
Monitoring Kafka w/ Prometheus
kawamuray
 
An Introduction to Prometheus
Evgeny Shmarnev
 
Prometheus for Monitoring Metrics (Fermilab 2018)
Brian Brazil
 
An Introduction to Prometheus (GrafanaCon 2016)
Brian Brazil
 
Breaking Prometheus (Promcon Berlin '16)
Matthew Campbell
 
Prometheus on AWS
Mitsuhiro Tanda
 
Monitoring Cloud Native Applications with Prometheus
Jacopo Nardiello
 
Weave Cortex: Multi-tenant, horizontally scalable Prometheus as a Service
Weaveworks
 
Monitoring_with_Prometheus_Grafana_Tutorial
Tim Vaillancourt
 
20171027 モニタリング勉強会
Paul Traylor
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Sridhar Kumar N
 
Cloud Monitoring tool Grafana
Dhrubaji Mandal ♛
 
Using Grails to power your electric car
Marco Pas
 
Prometheus Is Good for Your Small Startup - ShuttleCloud Corp. - 2016
ShuttleCloud
 
Server monitoring using grafana and prometheus
Celine George
 
Ad

Similar to Monitoring Kubernetes with Prometheus (20)

PDF
Heroku to Kubernetes & Gihub to Gitlab success story
Jérémy Wimsingues
 
PPTX
Introduction to Container Storage Interface (CSI)
Idan Atias
 
PDF
Intro to Kubernetes & GitOps Workshop
Weaveworks
 
PDF
Kubernetes - how to orchestrate containers
inovex GmbH
 
PDF
Time series denver an introduction to prometheus
Bob Cotton
 
PDF
Introduction to istio
Andrea Monacchi
 
PDF
Patroni: Kubernetes-native PostgreSQL companion
Alexander Kukushkin
 
PDF
AKS: k8s e azure
Alessandro Melchiori
 
PDF
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
PDF
WKSctl: Gitops Management of Kubernetes Clusters
Weaveworks
 
PDF
Deploying PostgreSQL on Kubernetes
Jimmy Angelakos
 
PPTX
Kubernetes #2 monitoring
Terry Cho
 
PPTX
Kubernetes 101
Stanislav Pogrebnyak
 
PDF
Kubernetes for the PHP developer
Paul Czarkowski
 
PDF
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC
 
PPTX
Kubernetes #1 intro
Terry Cho
 
PDF
Free GitOps Workshop
Weaveworks
 
PDF
Deploy 22 microservices from scratch in 30 mins with GitOps
Opsta
 
PDF
Kubernetes extensibility: crd & operators
Giacomo Tirabassi
 
PDF
Kubernetes extensibility: CRDs & Operators
SIGHUP
 
Heroku to Kubernetes & Gihub to Gitlab success story
Jérémy Wimsingues
 
Introduction to Container Storage Interface (CSI)
Idan Atias
 
Intro to Kubernetes & GitOps Workshop
Weaveworks
 
Kubernetes - how to orchestrate containers
inovex GmbH
 
Time series denver an introduction to prometheus
Bob Cotton
 
Introduction to istio
Andrea Monacchi
 
Patroni: Kubernetes-native PostgreSQL companion
Alexander Kukushkin
 
AKS: k8s e azure
Alessandro Melchiori
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
WKSctl: Gitops Management of Kubernetes Clusters
Weaveworks
 
Deploying PostgreSQL on Kubernetes
Jimmy Angelakos
 
Kubernetes #2 monitoring
Terry Cho
 
Kubernetes 101
Stanislav Pogrebnyak
 
Kubernetes for the PHP developer
Paul Czarkowski
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC
 
Kubernetes #1 intro
Terry Cho
 
Free GitOps Workshop
Weaveworks
 
Deploy 22 microservices from scratch in 30 mins with GitOps
Opsta
 
Kubernetes extensibility: crd & operators
Giacomo Tirabassi
 
Kubernetes extensibility: CRDs & Operators
SIGHUP
 
Ad

More from Tobias Schmidt (6)

PDF
Monitoring microservices with Prometheus
Tobias Schmidt
 
PDF
Efficient monitoring and alerting
Tobias Schmidt
 
PDF
Moving to Kubernetes - Tales from SoundCloud
Tobias Schmidt
 
PDF
Prometheus loves Grafana
Tobias Schmidt
 
PDF
16 months @ SoundCloud
Tobias Schmidt
 
PDF
Two database findings
Tobias Schmidt
 
Monitoring microservices with Prometheus
Tobias Schmidt
 
Efficient monitoring and alerting
Tobias Schmidt
 
Moving to Kubernetes - Tales from SoundCloud
Tobias Schmidt
 
Prometheus loves Grafana
Tobias Schmidt
 
16 months @ SoundCloud
Tobias Schmidt
 
Two database findings
Tobias Schmidt
 

Recently uploaded (20)

PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
Activate_Methodology_Summary presentatio
annapureddyn
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 

Monitoring Kubernetes with Prometheus