SlideShare a Scribd company logo
1 of 26
1
By OUHAMZA Lhouceine
2020
inge.lhouceine.ouhamza@gmail.com
2
Monitoring is one of the fundamental tasks in any system. It can help us to detect
problems and take action, or simply to know the current state of our systems.
➔ helps you reduce (or even eliminate) downtime.
➔ You can detect problems, and solve them before they impact users
Why monitoring?
3
We can:
➔ Expose Important metrics (data) over time
➔ Provide a way to configure rules, e.g (Cpu usage /80%)
➔ Send alerts (email) when rules are broken
➔ Provide visualization/Graphing
Monitoring
Monitoring tools: Sensu, Prometheus, Nagios
4
Prometheus is an in-memory dimensional time series database with a simple built-in UI,
a custom query language. Prometheus is designed to scrape metrics from application
instances periodically based on service discovery.
➔ A data scraper that pulls metrics data over HTTP periodically at a configured interval.
➔ A time-series database to store all the metrics data.
➔ A simple user interface where you can visualize, query, and monitor all the metrics.
➔ Written in Go, fully published in 2015.
➔ Second project hosted by SNCF after kubernetes
Prometheus
5
How prometheus works ?
6
What does prometheus monitor?
➔ Linux / windows servers ( CPU status, memory, Disk space …)
➔ Apache server (On/Off status…)
➔ Single application ( Exceptions, Requests count, client latency…)
➔ Service like database (status, Query Performance…)
7
Prometheus
8
Metrics
Metrics: all data as time series that prometheus can scrape it and stores it in his database.
Metrics has two metadata lines: Help and Type
Help: description of what the metrics is.
Type: we have 3 metrics types:
➔ Count: how many times x happened?
➔ Gauge: what is the current value of x now?
➔ Histogram; How long or how big? OpenMetrics format
9
Some examples of metrics
Current memory usage gauge
HTTP request latency gauge
CPU usage gauge
Number of threads in use count
Number of HTTP requests count
10
PromQL
Prometheus provides a functional query language called PromQL (Prometheus Query
Language) that lets the user select and aggregate time series data in real time. The result of an
expression can either be shown as a graph, viewed as tabular data in Prometheus's expression
browser, or consumed by external systems via the HTTP API.
Example:
Metric name Metric label
11
PromQL
Example Queries:
➔ Http_requests_total{status!~”4..”} : Query all HTTP status codes except 4xx ones.
➔ rate(Http_requests_total[5m])[30m:] : Returns the 5-minutes rate of the
http_requests_total metric for the past 30 min.
12
Target Endpoints and Exporters
In order to monitor anything with Prometheus, you need an exporter – a process that exposes
metrics for Prometheus to harvest.
The available exporters can be find from here: https://prometheus.io/docs/instrumenting/exporters/
13
Monitoring your own application
➔ How many requests?
➔ How many exceptions?
➔ How many server resources are used?
➔ Example: micrometer pour spring boot
Also you can use client libraries to expose metrics endpoints
14
Configuring prometheus
➔ How often Prometheus will scrape its targets
➔ Rules for aggregating metric values or creating
alerts when condition met
➔ What resources Prometheus monitors
prometheus.yml
15
AlertManager is a single binary which handles alerts sent by Prometheus server and notifies
end user through E-mail, Slack or other tools.
Example (custom rules):
➔ Is my server not running
➔ Average response time greater than 500Ms
➔ Is my server’s memory usage greater than 95%.
➔ Number of 404 errors greater than 10% of all requests.
AlertManager
16
➔ Is the open source analytics & monitoring solution for every database.
➔ Grafana allows you to bring data from various data sources like Elasticsearch,
Prometheus, Graphite, InfluxDB etc, and visualize them with beautiful graphs.
Grafana
17
➔ Create graphs easily
➔ Visualize data in differents ways
➔ Show graphs for different time periods
➔ Create dashboard to be viewed by others
➔ Allows us to easily make changes
Grafana features
18
Demo
19
We will monitor all this targets using prometheus and grafana
20
➔ Have you ever wondered how you can monitor your entire Linux system
performance easily?
➔ If you are looking for all those features, you are in the right place.
➔ Today we are taking a very special look at the Node Exporter, a Prometheus
exporter specialized in exposing Linux metrics.
Node Exporter
21
➔ Spring Boot uses Micrometer, an application metrics facade to integrate actuator
metrics with external monitoring systems.
➔ Micrometer supports several monitoring systems like Netflix Atlas, AWS Cloudwatch,
Datadog, InfluxData, SignalFx, Graphite, Wavefront, Prometheus etc.
➔ You should use actuator
➔ To integrate actuator with Prometheus, you need to add the micrometer-
registry-prometheus dependency.
Spring boot Application
22
Postgres / Sql Server Databases
➔ We want to alert the average response time
➔ Viewing active sessions
➔ Shared buffers
➔ Transactions
➔ Number of active connection
➔ Percentage of memory utilization
23
Nginx
➔ NGINX Prometheus exporter fetches the metrics from a single NGINX, converts
the metrics into appropriate Prometheus metrics types and finally exposes them
via an HTTP server to be collected by Prometheus.
➔ For NGINX, the following metrics are exported:
● Connections.
● HTTP.
24
Kubernetes cluster
Helm chart is the best way to deploy prometheus in k8s cluster. It create all
configuration yml files in one command.
helm install --name prometheus stable/prometheus-operator
kubectl get all
25
Conclusion
Prometheus is:
➔ Full Java Client
➔ Simple handling
➔ Supported by grafana ( Graphs )
➔ Full monitoring thanks to numerous exporters and libraries
➔ Service discovery e.g (Consul)
➔ Alerting with AlertManager
26

More Related Content

What's hot

MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)Lucas Jellema
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introductionRico Chen
 
An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)Brian Brazil
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaSridhar Kumar N
 
Prometheus Overview
Prometheus OverviewPrometheus Overview
Prometheus OverviewBrian Brazil
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy Docker, Inc.
 
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesExploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesRed Hat Developers
 
MySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaMySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaYoungHeon (Roy) Kim
 
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)Brian Brazil
 
End to-end monitoring with the prometheus operator - Max Inden
End to-end monitoring with the prometheus operator - Max IndenEnd to-end monitoring with the prometheus operator - Max Inden
End to-end monitoring with the prometheus operator - Max IndenParis Container Day
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basicsJuraj Hantak
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusGrafana Labs
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusGrafana Labs
 
Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018Grafana Labs
 
Grafana optimization for Prometheus
Grafana optimization for PrometheusGrafana optimization for Prometheus
Grafana optimization for PrometheusMitsuhiro Tanda
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with PrometheusQAware GmbH
 
Prometheus for Monitoring Metrics (Fermilab 2018)
Prometheus for Monitoring Metrics (Fermilab 2018)Prometheus for Monitoring Metrics (Fermilab 2018)
Prometheus for Monitoring Metrics (Fermilab 2018)Brian Brazil
 

What's hot (20)

MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)
 
Prometheus with Grafana - AddWeb Solution
Prometheus with Grafana - AddWeb SolutionPrometheus with Grafana - AddWeb Solution
Prometheus with Grafana - AddWeb Solution
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
 
An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
 
Prometheus Overview
Prometheus OverviewPrometheus Overview
Prometheus Overview
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy
 
Monitoring With Prometheus
Monitoring With PrometheusMonitoring With Prometheus
Monitoring With Prometheus
 
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesExploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on Kubernetes
 
MySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaMySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & Grafana
 
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
 
End to-end monitoring with the prometheus operator - Max Inden
End to-end monitoring with the prometheus operator - Max IndenEnd to-end monitoring with the prometheus operator - Max Inden
End to-end monitoring with the prometheus operator - Max Inden
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
 
Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018
 
Grafana optimization for Prometheus
Grafana optimization for PrometheusGrafana optimization for Prometheus
Grafana optimization for Prometheus
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with Prometheus
 
Prometheus for Monitoring Metrics (Fermilab 2018)
Prometheus for Monitoring Metrics (Fermilab 2018)Prometheus for Monitoring Metrics (Fermilab 2018)
Prometheus for Monitoring Metrics (Fermilab 2018)
 
Grafana
GrafanaGrafana
Grafana
 

Similar to Prometheus and Grafana

Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataGetInData
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Brian Brazil
 
IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...
IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...
IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...IRJET Journal
 
Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Brian Brazil
 
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHubMuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHubAlfonso Martino
 
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Brian Brazil
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Brian Brazil
 
Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Brian Brazil
 
Monitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorMonitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorLili Cosic
 
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdfPrometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdfKnoldus Inc.
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Brian Brazil
 
Introduction to Prometheus and Cortex (WOUG)
Introduction to Prometheus and Cortex (WOUG)Introduction to Prometheus and Cortex (WOUG)
Introduction to Prometheus and Cortex (WOUG)Weaveworks
 
Monitoring with prometheus at scale
Monitoring with prometheus at scaleMonitoring with prometheus at scale
Monitoring with prometheus at scaleJuraj Hantak
 
Monitoring with prometheus at scale
Monitoring with prometheus at scaleMonitoring with prometheus at scale
Monitoring with prometheus at scaleAdam Hamsik
 
How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...Paul Brebner
 
Manage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with ObservabilityManage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with ObservabilityNGINX, Inc.
 
Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021InfluxData
 

Similar to Prometheus and Grafana (20)

Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
 
Prometheus workshop
Prometheus workshopPrometheus workshop
Prometheus workshop
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with Prometheus
 
IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...
IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...
IRJET- Real Time Monitoring of Servers with Prometheus and Grafana for High A...
 
Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)
 
System monitoring
System monitoringSystem monitoring
System monitoring
 
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHubMuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
 
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 
Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)
 
Monitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorMonitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operator
 
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdfPrometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
 
Introduction to Prometheus and Cortex (WOUG)
Introduction to Prometheus and Cortex (WOUG)Introduction to Prometheus and Cortex (WOUG)
Introduction to Prometheus and Cortex (WOUG)
 
Monitoring with prometheus at scale
Monitoring with prometheus at scaleMonitoring with prometheus at scale
Monitoring with prometheus at scale
 
Monitoring with prometheus at scale
Monitoring with prometheus at scaleMonitoring with prometheus at scale
Monitoring with prometheus at scale
 
How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...
 
Manage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with ObservabilityManage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with Observability
 
Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021
 

More from Lhouceine OUHAMZA (15)

Présentation sur internet.pptx
Présentation sur internet.pptxPrésentation sur internet.pptx
Présentation sur internet.pptx
 
WEB SERVICE SOAP, JAVA, XML, JAXWS
WEB SERVICE SOAP, JAVA, XML, JAXWSWEB SERVICE SOAP, JAVA, XML, JAXWS
WEB SERVICE SOAP, JAVA, XML, JAXWS
 
Complete Java Course
Complete Java CourseComplete Java Course
Complete Java Course
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Scrum course
Scrum courseScrum course
Scrum course
 
Jenkins
JenkinsJenkins
Jenkins
 
Functional programming
Functional programmingFunctional programming
Functional programming
 
Formation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-dataFormation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-data
 
Hibernate jpa
Hibernate jpaHibernate jpa
Hibernate jpa
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Extreme Programming (XP)
Extreme Programming (XP)Extreme Programming (XP)
Extreme Programming (XP)
 
Systemes authentification
Systemes authentificationSystemes authentification
Systemes authentification
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring ioc
Spring iocSpring ioc
Spring ioc
 
Presentation of framework Angular
Presentation of framework AngularPresentation of framework Angular
Presentation of framework Angular
 

Recently uploaded

Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)ChandrakantDivate1
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementDr. Deepak Mudgal
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfthietkevietthinh
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information SystemsAnge Felix NSANZIYERA
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsMFatihSIRA
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptjigup7320
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...dannyijwest
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...ronahami
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Payal Garg #K09
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 

Recently uploaded (20)

Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdf
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI Applications
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 

Prometheus and Grafana

  • 2. 2 Monitoring is one of the fundamental tasks in any system. It can help us to detect problems and take action, or simply to know the current state of our systems. ➔ helps you reduce (or even eliminate) downtime. ➔ You can detect problems, and solve them before they impact users Why monitoring?
  • 3. 3 We can: ➔ Expose Important metrics (data) over time ➔ Provide a way to configure rules, e.g (Cpu usage /80%) ➔ Send alerts (email) when rules are broken ➔ Provide visualization/Graphing Monitoring Monitoring tools: Sensu, Prometheus, Nagios
  • 4. 4 Prometheus is an in-memory dimensional time series database with a simple built-in UI, a custom query language. Prometheus is designed to scrape metrics from application instances periodically based on service discovery. ➔ A data scraper that pulls metrics data over HTTP periodically at a configured interval. ➔ A time-series database to store all the metrics data. ➔ A simple user interface where you can visualize, query, and monitor all the metrics. ➔ Written in Go, fully published in 2015. ➔ Second project hosted by SNCF after kubernetes Prometheus
  • 6. 6 What does prometheus monitor? ➔ Linux / windows servers ( CPU status, memory, Disk space …) ➔ Apache server (On/Off status…) ➔ Single application ( Exceptions, Requests count, client latency…) ➔ Service like database (status, Query Performance…)
  • 8. 8 Metrics Metrics: all data as time series that prometheus can scrape it and stores it in his database. Metrics has two metadata lines: Help and Type Help: description of what the metrics is. Type: we have 3 metrics types: ➔ Count: how many times x happened? ➔ Gauge: what is the current value of x now? ➔ Histogram; How long or how big? OpenMetrics format
  • 9. 9 Some examples of metrics Current memory usage gauge HTTP request latency gauge CPU usage gauge Number of threads in use count Number of HTTP requests count
  • 10. 10 PromQL Prometheus provides a functional query language called PromQL (Prometheus Query Language) that lets the user select and aggregate time series data in real time. The result of an expression can either be shown as a graph, viewed as tabular data in Prometheus's expression browser, or consumed by external systems via the HTTP API. Example: Metric name Metric label
  • 11. 11 PromQL Example Queries: ➔ Http_requests_total{status!~”4..”} : Query all HTTP status codes except 4xx ones. ➔ rate(Http_requests_total[5m])[30m:] : Returns the 5-minutes rate of the http_requests_total metric for the past 30 min.
  • 12. 12 Target Endpoints and Exporters In order to monitor anything with Prometheus, you need an exporter – a process that exposes metrics for Prometheus to harvest. The available exporters can be find from here: https://prometheus.io/docs/instrumenting/exporters/
  • 13. 13 Monitoring your own application ➔ How many requests? ➔ How many exceptions? ➔ How many server resources are used? ➔ Example: micrometer pour spring boot Also you can use client libraries to expose metrics endpoints
  • 14. 14 Configuring prometheus ➔ How often Prometheus will scrape its targets ➔ Rules for aggregating metric values or creating alerts when condition met ➔ What resources Prometheus monitors prometheus.yml
  • 15. 15 AlertManager is a single binary which handles alerts sent by Prometheus server and notifies end user through E-mail, Slack or other tools. Example (custom rules): ➔ Is my server not running ➔ Average response time greater than 500Ms ➔ Is my server’s memory usage greater than 95%. ➔ Number of 404 errors greater than 10% of all requests. AlertManager
  • 16. 16 ➔ Is the open source analytics & monitoring solution for every database. ➔ Grafana allows you to bring data from various data sources like Elasticsearch, Prometheus, Graphite, InfluxDB etc, and visualize them with beautiful graphs. Grafana
  • 17. 17 ➔ Create graphs easily ➔ Visualize data in differents ways ➔ Show graphs for different time periods ➔ Create dashboard to be viewed by others ➔ Allows us to easily make changes Grafana features
  • 19. 19 We will monitor all this targets using prometheus and grafana
  • 20. 20 ➔ Have you ever wondered how you can monitor your entire Linux system performance easily? ➔ If you are looking for all those features, you are in the right place. ➔ Today we are taking a very special look at the Node Exporter, a Prometheus exporter specialized in exposing Linux metrics. Node Exporter
  • 21. 21 ➔ Spring Boot uses Micrometer, an application metrics facade to integrate actuator metrics with external monitoring systems. ➔ Micrometer supports several monitoring systems like Netflix Atlas, AWS Cloudwatch, Datadog, InfluxData, SignalFx, Graphite, Wavefront, Prometheus etc. ➔ You should use actuator ➔ To integrate actuator with Prometheus, you need to add the micrometer- registry-prometheus dependency. Spring boot Application
  • 22. 22 Postgres / Sql Server Databases ➔ We want to alert the average response time ➔ Viewing active sessions ➔ Shared buffers ➔ Transactions ➔ Number of active connection ➔ Percentage of memory utilization
  • 23. 23 Nginx ➔ NGINX Prometheus exporter fetches the metrics from a single NGINX, converts the metrics into appropriate Prometheus metrics types and finally exposes them via an HTTP server to be collected by Prometheus. ➔ For NGINX, the following metrics are exported: ● Connections. ● HTTP.
  • 24. 24 Kubernetes cluster Helm chart is the best way to deploy prometheus in k8s cluster. It create all configuration yml files in one command. helm install --name prometheus stable/prometheus-operator kubectl get all
  • 25. 25 Conclusion Prometheus is: ➔ Full Java Client ➔ Simple handling ➔ Supported by grafana ( Graphs ) ➔ Full monitoring thanks to numerous exporters and libraries ➔ Service discovery e.g (Consul) ➔ Alerting with AlertManager
  • 26. 26

Editor's Notes

  1. Sensu - A flexible and scalable telemetry and service health checking solution for monitoring servers, containers, services, applications, functions, and connected devices. Prometheus - Relies on the pull method to collect information, with a built-in database. Nagios - The legacy monitoring tool that introduced monitoring practices to a generation of operators.
  2. Metrics: Keys values pairs