(Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus...
Transcript of (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus...
![Page 1: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/1.jpg)
David Benque (Expert Cloud Solution)
Cedric Lamoriniere(Software engineer)
Prometheusun nouvel acteur dans le monde du monitoring
![Page 2: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/2.jpg)
Qui êtes vous ?
![Page 3: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/3.jpg)
Pourquoi monitorer votre infrastructure/applications?
● Savoir quand quelque chose ne va pas
○ Réagir avant d’avoir un “service outage”
● Aider à déboguer et votre application
● Comparer les performances de votre application entre
différentes versions
● Vous aidez dans vos décisions techniques/business
![Page 4: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/4.jpg)
Challenges du monitoring dans un environnement Cloud
● Adaptation à votre topologie dynamique / distribuée
● Découverte des métriques au fil de l’eau
● Cycles de vie cours de vos applications
● Agrégation de plusieurs indicateurs.
![Page 5: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/5.jpg)
Une solution: Prometheus
● Inspiré du système de monitoring Google
Borgmon
● Projet démarré par 2 Ex-Googlers chez
Soundcloud en 2012
● Open-source en 2015
● 2ème projet à joindre la CNCF
![Page 6: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/6.jpg)
Node 2Node 1 Node 3
Service
Service
Service
Service
Service
Prometheus
DB
DB-exporter
User request
Alert-Manager
DashboardGrafana
DevOps
node-exporter
n-e n-e
![Page 7: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/7.jpg)
DemoUtilisation Basic
![Page 8: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/8.jpg)
David Laptop
Demo
Prometheus
RestoService
Grafana
node-exporter
localhost:8080
localhost:8080/metrics
![Page 9: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/9.jpg)
Système de requête PromQL
● Quelle est la latence du 95ème percentile du datacenter A?
● Quelle sera le % d’utilisation du volume dans 4 heures?
● Quels sont les 5 plus gros utilisateurs de CPU?
topk(5,sum by (image)(
rate(container_cpu_usage_seconds_total{id=~"/system.slice/docker.*"}[5m]))
)
![Page 10: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/10.jpg)
Cloud Native intégration
Vos outils sont déjà instrumenté:
● Docker
● Etcd
● Consul
● Kubernetes
● ...
● Exporter pour les autres: Mongodb,
Redis, Kafka, Postgres, MariaDb, JMX, HAProxy,
Nginx….
Endpoints discovery:
● Consul
● Docker Swarm
● Kubernetes
● Mesos
● Your system
Instrumenter votre application:
Clients: Go, Java, Python, C++
![Page 11: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/11.jpg)
DemoService Discovery
![Page 12: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/12.jpg)
Demo
GCE
RestoServiceRestoService
RestoService
Prometheus
K8s-Master
Node-exporter
35.192.43.45:31909
Grafana
Prometheus Operator
![Page 13: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/13.jpg)
Avantages
● Model de donnée & format de requêtes efficaces
● Simple, Fiable et scalable
● Facilement intégrable dans votre application
● Solution d’alerting
![Page 14: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/14.jpg)
Model de donnée efficaces
● Toutes les mesures ont des labels multi-dimensionnelles
● Supporte “double” valeur, "Label" supporte unicode
● Stockage vraiment optimisé: 3.4 bytes par point (>v2.0.0)
● Un serveur support:
○ des millions de metrics
○ centaine de milliers de points par second
Extrement!1.3
![Page 15: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/15.jpg)
DemoScalabilité/Fédération
![Page 16: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/16.jpg)
David Laptop
Demo
Prometheus
RestoService
Grafana
node-exporter
GCEFederation
GCE2
RestoServiceRestoService
RestoService
RestoServiceRestoService
RestoService
Prometheus
Prometheus
K8s-Master
Node-exporter
35.192.43.45:31909
35.193.175.182:30560
![Page 17: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/17.jpg)
Prometheus Alert
alert: <alert_name>expr: <condition>for: 5m labels: severity: critical annotations: summary:<summary> description:<description>
alert: NODE_DISK_FREE_SPACE_ROOT_PARTITION_80 expr: ((node_filesystem_size{fstype="rootfs"}-node_filesystem_avail{fstype="rootfs"})/node_filesystem_size{fstype="rootfs"})*100 > 80 for: 5m labels: severity: critical annotations: summary: Current disk usage on root partition is {{ $value }}% on node {{ $labels.instance }} description: Current disk usage on root partition is {{ $value }}% on node {{ $labels.instance }}
alert: internal_error_rationexpr: http_response{return_code>=500}/http_response{}*100>2for: 5m labels: severity: critical annotations: summary: error ratio to high: {{ $value }}% description: Currently internal error ratio to high: {{ $value }}%
![Page 18: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/18.jpg)
DemoAlerts
![Page 19: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/19.jpg)
Demo Alert: HA configuration
Prometheus
Prometheus
Alert-Manager
Alert-Manager
Alert-Manager
Service
double scrap
dédoublement des alerts
SMS
Slack
![Page 20: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/20.jpg)
Prometheus architecture complète
Storage Exporter
![Page 21: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/21.jpg)
Conseil et Conclusion
● Commencer par instrumenté vos applications FWK.
● Migration: optez pour l’utilisation d’exporter (Nagios…)
● Bien choisir et limiter le nombre de labels
● Collecté que des metrics utiles à la création d’alertes
● Éviter les “flaky” alertes
![Page 22: (Expert Cloud Solution) Cedric Lamoriniere David …...2017/11/21 · Une solution: Prometheus Inspiré du système de monitoring Google Borgmon Projet démarré par 2 Ex-Googlers](https://reader030.fdocuments.fr/reader030/viewer/2022041019/5ecdace1e6a6dc1a70664035/html5/thumbnails/22.jpg)
Sop