<!-- This style apply by default to all slides, unless .slide is used. Note the use of the reveal class selector: this mean that only the presentation is affected by this style, and the makrdown preview or the book mode of hackmd.io is style intact. If you want/need a resizable background image, add the background-size: cover; property and change background-position: 0px 0px; --> <style> .reveal { /*background-color: #eaeaea;*/ background-image: url('https://epfl-si.github.io/elements/svg/epfl-logo.svg'); background-repeat: no-repeat; background-position: 5px 5px; } .reveal { color: #1c1c1c; } .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { color: #eee; text-shadow: 2px 2px #ff0000; } .reveal a { color: #f009; } .reveal a:hover { color: #f00; } .reveal code { padding-top: 0.2em; padding-bottom: 0.2em; margin: 0; font-size: 85%; background-color: rgba(255, 255, 255, 0.46); border-radius: 3px; } [data-contrast="on"] > div { background-color: #ffffff50; } [data-contrast="on+"] > div { background-color: #ffffff99; } </style> <!-- .slide: data-background="https://i.imgur.com/V91Puk5.png" data-contrast="on+" https://unsplash.com/photos/R2OM3BvN-Uo --> ## Prometheus Présentation à l'attention de ITOP-SDDC <small>Nicolas Borboën <<nicolas.borboen@epfl.ch>></small> ---- <!-- .slide: data-background="https://i.imgur.com/U7xtQCy.png" https://unsplash.com/photos/9zhsq3o1k60 --> ## Introduction ---- <!-- .slide: data-background="https://i.imgur.com/nFNEHEg.jpg" https://unsplash.com/photos/rqWoB4LFgmc --> ## Pourquoi est-on là Note: - Mieux comprendre prometheus - Grouper les efforts - Partage de connaissance - Homogénisation des outils ---- <!-- .slide: data-contrast="on+" data-background="https://i.imgur.com/jzRobST.jpg" https://unsplash.com/photos/_4og9SdhGIg --> ## Lien vers la présentation https://hackmd.io/@ponsfrilus/prometheus <small>Toutes les photos viennent du site https://unsplash.com (libre de droits)</small> Note: Le thème des images de fond est le sable noir (https://en.wikipedia.org/wiki/Black_sand) --- <!-- .slide: data-background="https://i.imgur.com/BTk3Gbg.png" https://unsplash.com/photos/8xznAGy4HcY --> ![](https://i.imgur.com/0vw8VpF.png) ---- <!-- .slide: data-contrast="on+" --> ## Histoire * Prometheus was developed at SoundCloud starting in 2012 * https://sre.google/sre-book/practical-alerting/#the-rise-of-borgmon ---- <!-- .slide: data-contrast="on+" --> > Prometheus is a **metrics collection** and **alerting tool** developed and released to open source by SoundCloud. Prometheus is similar in design to **Google's Borgmon monitoring system**. Properly tuned and deployed, a Prometheus cluster **can collect millions of metrics every second**. > <small>Source: https://www.redhat.com/sysadmin/introduction-prometheus-metrics-and-performance-monitoring</small> &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Time series > Prometheus fundamentally **stores all data as time series**: streams of timestamped values belonging to the same metric and the same set of labeled dimensions. > <small>Source: https://prometheus.io/docs/concepts/data_model/</small> &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Metrics > Every time series is uniquely identified by its **metric name** and optional key-value pairs called labels. > <small>Source: https://prometheus.io/docs/concepts/data_model/</small> &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Metrics * Counter * Gauge * Histogram * Summary <small>Source: https://prometheus.io/docs/concepts/metric_types/</small> ---- <!-- .slide: data-contrast="on+" --> ## Counter > A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only **increase or be reset to zero** on restart. &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Gauge > A gauge is a metric that represents a **single numerical value** that can arbitrarily go up and down. &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Histogrammes and summary > A histogram **samples** observations and counts them in configurable **buckets**. It also provides a **sum of all observed values**. > > Similar to a histogram, a summary samples observations. &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Labels > Labels enable Prometheus's **dimensional data model**: any given combination of labels for the same metric name identifies a particular dimensional instantiation of that metric. See also the [best practices for naming metrics and labels](https://prometheus.io/docs/practices/naming/). ---- <!-- .slide: data-contrast="on+" --> ## Examples Given a metric name and a set of labels, time series are frequently identified using this notation: `<metric name>{<label name>=<label value>, ...}` For example, a time series with the metric name api_http_requests_total and the labels method="POST" and handler="/messages" could be written like this: `api_http_requests_total{method="POST", handler="/messages"}` ---- <!-- .slide: data-contrast="on+" --> ## PromQL > The **query language** allows filtering and aggregation based on these dimensions. > > Changing any label value, including adding or removing a label, will create a new time series. &nbsp; ---- <!-- .slide: data-contrast="on+" --> ## Federation > Federation allows a Prometheus server to **scrape** selected time series from **another** Prometheus server. <small>Source: https://prometheus.io/docs/prometheus/latest/federation/</small> --- <!-- .slide: data-background="https://i.imgur.com/MfvS8Vv.png" https://unsplash.com/photos/nlxeRct7zic --> ## Eco-system ---- <!-- .slide: data-background="https://i.imgur.com/CV3jS1v.jpg" https://unsplash.com/photos/2M_DMVrt444 --> ## Prometheus ---- <!-- .slide: data-contrast="on+" --> ## Exporters * node-exporter * blackbox-exporter * ... * https://prometheus.io/docs/instrumenting/exporters/ ---- <!-- .slide: data-contrast="on+" --> ## Alertmanager * https://prometheus.io/docs/alerting/latest/alertmanager/ * https://github.com/prometheus/alertmanager ---- <!-- .slide: data-contrast="on+" --> ## Pushgateway The Pushgateway is an intermediary service which allows you to push metrics from jobs which cannot be scraped. https://prometheus.io/docs/practices/pushing/#when-to-use-the-pushgateway ---- <!-- .slide: data-contrast="on+" --> ## Grafana ![](https://i.imgur.com/azj9mxH.png) https://grafana.com/ ---- <!-- .slide: data-contrast="on+" --> ## Thanos ![](https://i.imgur.com/JlrJjKl.png) https://thanos.io/ --- <!-- .slide: data-contrast="on+" data-background="https://i.imgur.com/in0b6hR.jpg" https://unsplash.com/photos/GIg_pmTYGn4 --> ## Deployment * Prometheus Operator * kube-prometheus * helm chart → détails ---- <!-- .slide: data-contrast="on+" --> ### Prometheus Operator https://github.com/prometheus-operator/prometheus-operator The Prometheus Operator uses Kubernetes custom resources to simplify the deployment and configuration of Prometheus, Alertmanager, and related monitoring components. ---- <!-- .slide: data-contrast="on+" --> ### kube-prometheus https://github.com/prometheus-operator/kube-prometheus kube-prometheus provides example configurations for a complete cluster monitoring stack based on Prometheus and the Prometheus Operator. ---- <!-- .slide: data-contrast="on+" --> ### helm chart https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack The prometheus-community/kube-prometheus-stack helm chart provides a similar feature set to kube-prometheus. This chart is maintained by the Prometheus community. ---- <!-- .slide: data-contrast="on+" --> ## Argo CD ![](https://i.imgur.com/89rQUUg.png) https://argoproj.github.io/ --- <!-- .slide: data-contrast="on+" --> ## Stockage * Thanos, S3, WAL 2Go, PVC 4Go (4h) --- <!-- .slide: data-contrast="on+" data-background="https://i.imgur.com/fyLS3E4.jpg" https://unsplash.com/photos/T5Pm7ZId3sc --> ## Mise à jour [stability promise](https://prometheus.io/docs/prometheus/latest/migration/) ---- <!-- .slide: data-contrast="on+" --> ## Promtool * https://prometheus.io/docs/prometheus/latest/configuration/unit_testing_rules/ --- ## WordPress ![](https://i.imgur.com/bCNcwr6.png) ---- ### Conteneurs dans les pods prometheus et pushgateways d'OpenShift ![](https://i.imgur.com/3WfG82O.png) ---- ### Détails des containers du NOC ![](https://i.imgur.com/Eve9I05.png) --- <!-- .slide: data-background="https://i.imgur.com/oHcM67H.jpg" data-contrast="on" https://unsplash.com/photos/BW1Y7BQSctQ --> ## Demo(s) ---- <!-- .slide: data-contrast="on+" --> ## Monitoringrafana Un petit projet ayant pour but de déployer prometheus, grafana et un node-exporter avec docker. Fait pour hacker et comprendre. Parfait sur un laptop. https://github.com/epfl-dojo/monitoringrafana ---- <!-- .slide: data-background="https://i.imgur.com/4etRtMX.jpg" data-contrast="on" https://unsplash.com/photos/xdf1gU-LCnc --> ## Demo as a service --- <!-- .slide: data-background="https://i.imgur.com/l6XGvOf.jpg" data-contrast="on" https://unsplash.com/photos/bVaGWWyA--8 --> ## This is the end Encore une question ? Un point à disctuer ? Nicolas Borboën <<nicolas.borboen@epfl.ch>>
{"metaMigratedAt":"2023-06-17T00:35:27.938Z","metaMigratedFrom":"YAML","title":"Prometheus@EPFL","breaks":false,"description":"Some thoughts about Prometheus@EPFL","slideOptions":"{\"transition\":\"convex\",\"theme\":\"black\",\"spotlight\":{\"enabled\":false},\"progress\":true}","contributors":"[{\"id\":\"98cf1d10-5049-49ca-9160-3f2e67fc1067\",\"add\":13073,\"del\":3440}]"}
    556 views