SlideShare a Scribd company logo
Monitoring With Prometheus
Richard Langlois P. Eng. and Gervais Naoussi, Sept. 2018
Agenda
2
• Monitoring Concepts
• Micrometer
• Prometheus
• Grafana
• Demo
Monitoring
3
Monitoring is the tools and processes by which you measure your technology systems.
A monitoring system has two customers:
• Technology (Engineering, Operations, DevOps)
• The business (measure the value that technology delivers to business)
If you’re building a specification or user stories for your application:
include metrics and monitoring for each component of your application.
Don’t wait until the end of a project or just before deployment.
Monitoring
Approach to Monitoring
4
A good approach to your monitoring is to design a top-down monitoring plan based on
value.
Identify the parts of the application that deliver value and monitor those first, working
your way down the stack.
Monitoring for the correctness of a service first
 e.g. monitor the content or rates of a business transaction rather than the uptime
of the web server it runs on.
Monitoring
Monitoring Approaches
5
2 major approaches:
• Probing monitoring probes the outside of an application (black-box monitoring).
e.g. Nagios
• Introspection monitoring looks at what’s inside the application (white-box monitoring)
application is instrumented and returns measurements of its state
Monitoring
Pull vs Push
6
Two approaches to how monitoring checks are executed:
• Pull-based: systems scrape or check a remote application—for example, an endpoint
containing metrics.
• Push-based: applications emit events that are received by the monitoring system.
Prometheus is primarily a pull-based system, but it also supports receiving events pushed
into a gateway.
Monitoring
Metric
7
Metrics are measures of properties of components of software or hardware.
To make a metric useful we keep track of its state, generally recording data points over time (called
observations).
An observation consists of:
value,
a timestamp,
and sometimes a series of properties that describe the observation such as a source or tags.
A collection of observations is called a time series.
Time series data is a chronologically ordered list of these observations.
Time series metrics are often visualized as a two-dimensional plot with data values on the y-axis and
time on the x-axis.
Monitoring
Types of monitoring data
8
Monitoring tools can collect 2 types of data:
• Metrics are stored as time series data that record the state of measures of your
applications.
• Logs are (usually textual) events emitted from an application.
Prometheus is primarily focused on collecting time series data.
Monitoring
Type of Metrics
9
Variety of different types of metrics:
Gauges: are numbers that are expected to go up or down. A snapshot of a specific measurement.
 e.g. Disk usage, number of customers present on a site.
Counters: are numbers that increase over time and never decrease.
 e.g. system uptime, number of sales in a month
Histograms: is a metric that samples observations. Each observation is counted and placed into
buckets.
Metric Summaries: mathematical transformations applied to metrics
• Average
• Median
• Standard Deviation
• Percentile
Agenda
10
• Monitoring Concepts
• Micrometer
• Prometheus
• Grafana
• Demo
Micrometer
Intro
11
Micrometer is a metrics instrumentation library allowing to instrument JVM-based
application code without vendor lock-in.
It provides a simple façade over the instrumentation clients for the most popular monitoring
systems.
Think SLF4J, but for application metrics.
As of Spring Boot 2.0.0.M5, Micrometer is the instrumentation library used by Spring.
Some supported monitoring systems:
• Datadog
• Graphite
• Influx
• JMX
• New Relic
• Prometheus
• SignalFX
• StatsD
Micrometer
API
12
Meter is the interface for collecting a set of measurements (called metrics).
MeterRegistry: eters are created from and held in a Meter Registry
Each supported monitoring system has an implementation of MeterRegistry.
SimpleMeterRegistry: Automatically autowired in Spring-based apps.
MeterRegistry registry = new SimpleMeterRegistry.
Set of meter primitives:
Timer, Counter, Gauge, DistributionSummary, LongTaskTimer, FunctionCounter, FunctionTimer
and TimeGauge.
Dimensions allow a particular named metric to be sliced to drill down.
E.g. Registry.counter(“http.server.requests”, “uri”, “/api/users”)
Fluent builder:
Counter counter = Counter .builder("counter")
.baseUnit(“ms")
.description("a description of what this counter does")
.tags("region", "test")
.register(registry);
Agenda
13
• Monitoring Concepts
• Micrometer
• Prometheus
• Grafana
• Demo
Prometheus
Intro
14
Prometheus is a simple, effective open-source monitoring system.
Promoted from incubation to graduation (in August 2018), in Cloud Native Computing Foundation (CNCF)
Prometheus works by scraping (pulling) time series data exposed from applications.
The time series data is exposed by the applications themselves often via client libraries or via proxies
called exporters, as HTTP endpoints.
Prometheus
Concepts
15
Prometheus calls the source of metrics it can scrape endpoints.
An endpoint usually corresponds to a single process, host, service, or application.
The resulting time series data is collected
and stored locally on the Prometheus server (15 days retention)
and can be sent from the server to external storage or to another time series database.
Prometheus can also define Rules for alerting.
Prometheus
PromQL – inbuilt querying language
16
The Prometheus server also comes with an inbuilt querying language, PromQL, allowing to
query and aggregate metrics.
Use this query language in the query input box in the Expression Browser.
e.g: Query all metrics with a label of quantile=“0.5”:
Prometheus
Expression Browser
17
http://localhost:9090/graph
Prometheus
Scalability
18
Designed to scale to millions of time series from many thousands of hosts.
Its data storage format is designed to keep disk use down and provide fast retrieval of time series
during queries and aggregations.
SSD disks are recommended for Prometheus servers, for speed and reliability.
Redundant Prometheus Architecture:
Prometheus
Data Model
19
Prometheus collects time series data.
Format:
<time series name>{<label name>=<label value>, ...}
Each time series is uniquely identified by the combination of names and key/value pairs
called labels (provide the dimensions).
Name usually describes the general nature of the time series data being collected
 e.g. total_website_visits as the total number of website visits.
Labels enable the Prometheus dimensional data model, they add context to a specific
time series.
 e.g. the name of the website, IP of the requester
Prometheus
Time Series Notation
20
Example
total_website_visits{site=“alithya.com", location="NJ", instance="webserver“, job="web"}
All time series generally have
• an instance label, which identifies the source host or application
• a job label, which contains the name of the job that scraped the specific time series.
Actual value of the time series is called a sample.
Consists of:
• A float64 value.
• A millisecond-precision timestamp.
Prometheus configuration
prometheus.yml
21
Prometheus is configured via YAML configuration files.
Default Configuration file has the following 4 YAML blocks defined:
Global: contains global settings for controlling the Prometheus server’s behavior.
Alerting: configures Prometheus’ alerting.
rule_files: specifies a list of files that can contain recording or alerting rules.
scrape_configs: specifies all of the targets that Prometheus will scrape.
Prometheus and Spring Boot
22
Spring Boot auto-configures a composite MeterRegistry and adds a registry to the composite for each of the supported
implementations that it finds on the classpath.
pom.xml:
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>0.1.0</version>
</dependency
The simpleclient_spring_boot dependency provides the @EnablePrometheusEndpoint annotation.
Adding it to a @configuration class, creates a HTTP endpoint accessible via /actuator/prometheus that exposes all registered
(actuator) metrics in a Prometheus data format.
Prometheus configuration
Scrape Config for Spring Boot application
23
Prometheus scrapes the following 2 endpoints
• /prometheus endpoint: contains Spring boot metrics
• /metrics endpoint: Prometheus own metrics
scrape_configs:
# The job name is added as a label `job=<job_name>` to any time series scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['PROM_IP:9090']
- job_name: 'spring-boot'
metrics_path: '/prometheus'
scrape_interval: 5s
static_configs:
- targets: ['App_IP:8080']
Prometheus
Dashboard
24
Example of metrics on Prometheus dashboard:
Prometheus
Alerting
25
Alerting is provided by a tool called Alertmanager
Alerting rules are defined on the Prometheus server.
When the threshold or criteria is met, an alert will be generated and pushed to Alertmanager.
The alerts are received on an HTTP endpoint on the Alertmanager.
Alertmanager handles deduplicating, grouping, and routing alerts to receivers (e.g. email, SMS, PagerDuty)
Prometheus
Alerting Configuration
26
A simple alertmanager.yml configuration file, sending alerts by email:
Prometheus
Alerting Web Interface
27
Web interface to:
• view current alerts
• manage maintenance window alert suppression (silences)
Prometheus
Pushgateway
28
Metrics can be pushed to Pushgateway when there isn’t a target from which to scrape metrics because:
• can’t reach the target resources because of security
• target resource has too short a lifespan (e.g. container starting, executing, and stopping).
• target resource doesn’t have an endpoint, (e.g. batch job).
Pushgateway sits between an application sending metrics and the Prometheus server.
Pushgateway is scraped as a target to deliver the metrics to the Prometheus server.
Agenda
29
• Monitoring Concepts
• Micrometer
• Prometheus
• Grafana
• Demo
Grafana
30
Prometheus UI is not really nice.
Alternative: Grafana is open source metrics Dashboard platform.
It supports multiple backend time-series databases including:
Prometheus , InfluxDB, Elasticsearch, Cloudwatch …
Example of Grafana dashboard:
Grafana
Prometheus as Data source
31
Grafana
Prometheus as Datasource
32
Before you create your first dashboard you need to add your data source.
Grafana
Prometheus as Datasource
33
Name: your choice
Default: Check to tell Grafana to search for data in this source by default
Type: Prometheus
URL: URL of the Prometheus server to query.
Agenda
34
• Monitoring Concepts
• Micrometer
• Prometheus
• Grafana
• Demo
References
35
Micrometer:
• https://micrometer.io
Prometheus
• Book: Monitoring with Prometheus, James Turnbull, 2018.
• https://prometheus.io
Graphana
• https://grafana.com/
Thank You
36
Ad

More Related Content

What's hot (20)

Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
Grafana Labs
 
Infrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusInfrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using Prometheus
Marco Pas
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
Syah Dwi Prihatmoko
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
Juraj Hantak
 
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
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For Architects
Kevin Brockhoff
 
Logs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackLogs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK Stack
Josef Karásek
 
Terraform
TerraformTerraform
Terraform
Pathum Fernando ☁
 
Server monitoring using grafana and prometheus
Server monitoring using grafana and prometheusServer monitoring using grafana and prometheus
Server monitoring using grafana and prometheus
Celine George
 
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
Red Hat Developers
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
Grafana Labs
 
OpenTelemetry Introduction
OpenTelemetry Introduction OpenTelemetry Introduction
OpenTelemetry Introduction
DimitrisFinas1
 
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Brian Brazil
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy
Docker, Inc.
 
Grafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for LogsGrafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for Logs
Marco Pracucci
 
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Vietnam Open Infrastructure User Group
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
Rico Chen
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
Yevgeniy Brikman
 
PromQL Deep Dive - The Prometheus Query Language
PromQL Deep Dive - The Prometheus Query Language PromQL Deep Dive - The Prometheus Query Language
PromQL Deep Dive - The Prometheus Query Language
Weaveworks
 
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
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
Grafana Labs
 
Infrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusInfrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using Prometheus
Marco Pas
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
Syah Dwi Prihatmoko
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
Juraj Hantak
 
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
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For Architects
Kevin Brockhoff
 
Logs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackLogs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK Stack
Josef Karásek
 
Server monitoring using grafana and prometheus
Server monitoring using grafana and prometheusServer monitoring using grafana and prometheus
Server monitoring using grafana and prometheus
Celine George
 
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
Red Hat Developers
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
Grafana Labs
 
OpenTelemetry Introduction
OpenTelemetry Introduction OpenTelemetry Introduction
OpenTelemetry Introduction
DimitrisFinas1
 
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Brian Brazil
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy
Docker, Inc.
 
Grafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for LogsGrafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for Logs
Marco Pracucci
 
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Vietnam Open Infrastructure User Group
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
Rico Chen
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
Yevgeniy Brikman
 
PromQL Deep Dive - The Prometheus Query Language
PromQL Deep Dive - The Prometheus Query Language PromQL Deep Dive - The Prometheus Query Language
PromQL Deep Dive - The Prometheus Query Language
Weaveworks
 
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
 

Similar to Monitoring with Prometheus (20)

Prometheus workshop
Prometheus workshopPrometheus workshop
Prometheus workshop
OpsTree solutions
 
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
 
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
GetInData
 
Google Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixGoogle Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with Zabbix
Max Kuzkin
 
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic SystemTimely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Accumulo Summit
 
Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software Validation
BioDec
 
Performance eng prakash.sahu
Performance eng prakash.sahuPerformance eng prakash.sahu
Performance eng prakash.sahu
Dr. Prakash Sahu
 
Dot Net performance monitoring
 Dot Net performance monitoring Dot Net performance monitoring
Dot Net performance monitoring
Kranthi Paidi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
Ala Qunaibi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
Ala Qunaibi
 
Webinar - Building Custom Extensions With AppDynamics
Webinar - Building Custom Extensions With AppDynamicsWebinar - Building Custom Extensions With AppDynamics
Webinar - Building Custom Extensions With AppDynamics
Todd Radel
 
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
Paul Brebner
 
Observability and its application
Observability and its applicationObservability and its application
Observability and its application
Thao Huynh Quang
 
How to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based WorldHow to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based World
Ken Owens
 
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
 
Azure Monitoring Overview
Azure Monitoring OverviewAzure Monitoring Overview
Azure Monitoring Overview
gjuljo
 
Apache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San JoseApache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San Jose
Hao Chen
 
Apache Eagle: Secure Hadoop in Real Time
Apache Eagle: Secure Hadoop in Real TimeApache Eagle: Secure Hadoop in Real Time
Apache Eagle: Secure Hadoop in Real Time
DataWorks Summit/Hadoop Summit
 
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
 
Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...
Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...
Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...
Tony Erwin
 
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
 
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
GetInData
 
Google Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixGoogle Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with Zabbix
Max Kuzkin
 
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic SystemTimely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Accumulo Summit
 
Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software Validation
BioDec
 
Performance eng prakash.sahu
Performance eng prakash.sahuPerformance eng prakash.sahu
Performance eng prakash.sahu
Dr. Prakash Sahu
 
Dot Net performance monitoring
 Dot Net performance monitoring Dot Net performance monitoring
Dot Net performance monitoring
Kranthi Paidi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
Ala Qunaibi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
Ala Qunaibi
 
Webinar - Building Custom Extensions With AppDynamics
Webinar - Building Custom Extensions With AppDynamicsWebinar - Building Custom Extensions With AppDynamics
Webinar - Building Custom Extensions With AppDynamics
Todd Radel
 
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
Paul Brebner
 
Observability and its application
Observability and its applicationObservability and its application
Observability and its application
Thao Huynh Quang
 
How to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based WorldHow to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based World
Ken Owens
 
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
 
Azure Monitoring Overview
Azure Monitoring OverviewAzure Monitoring Overview
Azure Monitoring Overview
gjuljo
 
Apache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San JoseApache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San Jose
Hao Chen
 
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
 
Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...
Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...
Monitoring Node.js Microservices on CloudFoundry with Open Source Tools and a...
Tony Erwin
 
Ad

More from Richard Langlois P. Eng. (7)

Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Richard Langlois P. Eng.
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Richard Langlois P. Eng.
 
Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5
Richard Langlois P. Eng.
 
What's New in Java 9
What's New in Java 9What's New in Java 9
What's New in Java 9
Richard Langlois P. Eng.
 
DevOps, Yet Another IT Revolution
DevOps, Yet Another IT RevolutionDevOps, Yet Another IT Revolution
DevOps, Yet Another IT Revolution
Richard Langlois P. Eng.
 
What is new in JUnit5
What is new in JUnit5What is new in JUnit5
What is new in JUnit5
Richard Langlois P. Eng.
 
Introduction to Reactive Microservices Architecture.
Introduction to Reactive Microservices Architecture.Introduction to Reactive Microservices Architecture.
Introduction to Reactive Microservices Architecture.
Richard Langlois P. Eng.
 
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Richard Langlois P. Eng.
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Richard Langlois P. Eng.
 
Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5
Richard Langlois P. Eng.
 
Introduction to Reactive Microservices Architecture.
Introduction to Reactive Microservices Architecture.Introduction to Reactive Microservices Architecture.
Introduction to Reactive Microservices Architecture.
Richard Langlois P. Eng.
 
Ad

Recently uploaded (20)

Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 

Monitoring with Prometheus

  • 1. Monitoring With Prometheus Richard Langlois P. Eng. and Gervais Naoussi, Sept. 2018
  • 2. Agenda 2 • Monitoring Concepts • Micrometer • Prometheus • Grafana • Demo
  • 3. Monitoring 3 Monitoring is the tools and processes by which you measure your technology systems. A monitoring system has two customers: • Technology (Engineering, Operations, DevOps) • The business (measure the value that technology delivers to business) If you’re building a specification or user stories for your application: include metrics and monitoring for each component of your application. Don’t wait until the end of a project or just before deployment.
  • 4. Monitoring Approach to Monitoring 4 A good approach to your monitoring is to design a top-down monitoring plan based on value. Identify the parts of the application that deliver value and monitor those first, working your way down the stack. Monitoring for the correctness of a service first  e.g. monitor the content or rates of a business transaction rather than the uptime of the web server it runs on.
  • 5. Monitoring Monitoring Approaches 5 2 major approaches: • Probing monitoring probes the outside of an application (black-box monitoring). e.g. Nagios • Introspection monitoring looks at what’s inside the application (white-box monitoring) application is instrumented and returns measurements of its state
  • 6. Monitoring Pull vs Push 6 Two approaches to how monitoring checks are executed: • Pull-based: systems scrape or check a remote application—for example, an endpoint containing metrics. • Push-based: applications emit events that are received by the monitoring system. Prometheus is primarily a pull-based system, but it also supports receiving events pushed into a gateway.
  • 7. Monitoring Metric 7 Metrics are measures of properties of components of software or hardware. To make a metric useful we keep track of its state, generally recording data points over time (called observations). An observation consists of: value, a timestamp, and sometimes a series of properties that describe the observation such as a source or tags. A collection of observations is called a time series. Time series data is a chronologically ordered list of these observations. Time series metrics are often visualized as a two-dimensional plot with data values on the y-axis and time on the x-axis.
  • 8. Monitoring Types of monitoring data 8 Monitoring tools can collect 2 types of data: • Metrics are stored as time series data that record the state of measures of your applications. • Logs are (usually textual) events emitted from an application. Prometheus is primarily focused on collecting time series data.
  • 9. Monitoring Type of Metrics 9 Variety of different types of metrics: Gauges: are numbers that are expected to go up or down. A snapshot of a specific measurement.  e.g. Disk usage, number of customers present on a site. Counters: are numbers that increase over time and never decrease.  e.g. system uptime, number of sales in a month Histograms: is a metric that samples observations. Each observation is counted and placed into buckets. Metric Summaries: mathematical transformations applied to metrics • Average • Median • Standard Deviation • Percentile
  • 10. Agenda 10 • Monitoring Concepts • Micrometer • Prometheus • Grafana • Demo
  • 11. Micrometer Intro 11 Micrometer is a metrics instrumentation library allowing to instrument JVM-based application code without vendor lock-in. It provides a simple façade over the instrumentation clients for the most popular monitoring systems. Think SLF4J, but for application metrics. As of Spring Boot 2.0.0.M5, Micrometer is the instrumentation library used by Spring. Some supported monitoring systems: • Datadog • Graphite • Influx • JMX • New Relic • Prometheus • SignalFX • StatsD
  • 12. Micrometer API 12 Meter is the interface for collecting a set of measurements (called metrics). MeterRegistry: eters are created from and held in a Meter Registry Each supported monitoring system has an implementation of MeterRegistry. SimpleMeterRegistry: Automatically autowired in Spring-based apps. MeterRegistry registry = new SimpleMeterRegistry. Set of meter primitives: Timer, Counter, Gauge, DistributionSummary, LongTaskTimer, FunctionCounter, FunctionTimer and TimeGauge. Dimensions allow a particular named metric to be sliced to drill down. E.g. Registry.counter(“http.server.requests”, “uri”, “/api/users”) Fluent builder: Counter counter = Counter .builder("counter") .baseUnit(“ms") .description("a description of what this counter does") .tags("region", "test") .register(registry);
  • 13. Agenda 13 • Monitoring Concepts • Micrometer • Prometheus • Grafana • Demo
  • 14. Prometheus Intro 14 Prometheus is a simple, effective open-source monitoring system. Promoted from incubation to graduation (in August 2018), in Cloud Native Computing Foundation (CNCF) Prometheus works by scraping (pulling) time series data exposed from applications. The time series data is exposed by the applications themselves often via client libraries or via proxies called exporters, as HTTP endpoints.
  • 15. Prometheus Concepts 15 Prometheus calls the source of metrics it can scrape endpoints. An endpoint usually corresponds to a single process, host, service, or application. The resulting time series data is collected and stored locally on the Prometheus server (15 days retention) and can be sent from the server to external storage or to another time series database. Prometheus can also define Rules for alerting.
  • 16. Prometheus PromQL – inbuilt querying language 16 The Prometheus server also comes with an inbuilt querying language, PromQL, allowing to query and aggregate metrics. Use this query language in the query input box in the Expression Browser. e.g: Query all metrics with a label of quantile=“0.5”:
  • 18. Prometheus Scalability 18 Designed to scale to millions of time series from many thousands of hosts. Its data storage format is designed to keep disk use down and provide fast retrieval of time series during queries and aggregations. SSD disks are recommended for Prometheus servers, for speed and reliability. Redundant Prometheus Architecture:
  • 19. Prometheus Data Model 19 Prometheus collects time series data. Format: <time series name>{<label name>=<label value>, ...} Each time series is uniquely identified by the combination of names and key/value pairs called labels (provide the dimensions). Name usually describes the general nature of the time series data being collected  e.g. total_website_visits as the total number of website visits. Labels enable the Prometheus dimensional data model, they add context to a specific time series.  e.g. the name of the website, IP of the requester
  • 20. Prometheus Time Series Notation 20 Example total_website_visits{site=“alithya.com", location="NJ", instance="webserver“, job="web"} All time series generally have • an instance label, which identifies the source host or application • a job label, which contains the name of the job that scraped the specific time series. Actual value of the time series is called a sample. Consists of: • A float64 value. • A millisecond-precision timestamp.
  • 21. Prometheus configuration prometheus.yml 21 Prometheus is configured via YAML configuration files. Default Configuration file has the following 4 YAML blocks defined: Global: contains global settings for controlling the Prometheus server’s behavior. Alerting: configures Prometheus’ alerting. rule_files: specifies a list of files that can contain recording or alerting rules. scrape_configs: specifies all of the targets that Prometheus will scrape.
  • 22. Prometheus and Spring Boot 22 Spring Boot auto-configures a composite MeterRegistry and adds a registry to the composite for each of the supported implementations that it finds on the classpath. pom.xml: <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_spring_boot</artifactId> <version>0.1.0</version> </dependency> <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_hotspot</artifactId> <version>0.1.0</version> </dependency The simpleclient_spring_boot dependency provides the @EnablePrometheusEndpoint annotation. Adding it to a @configuration class, creates a HTTP endpoint accessible via /actuator/prometheus that exposes all registered (actuator) metrics in a Prometheus data format.
  • 23. Prometheus configuration Scrape Config for Spring Boot application 23 Prometheus scrapes the following 2 endpoints • /prometheus endpoint: contains Spring boot metrics • /metrics endpoint: Prometheus own metrics scrape_configs: # The job name is added as a label `job=<job_name>` to any time series scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['PROM_IP:9090'] - job_name: 'spring-boot' metrics_path: '/prometheus' scrape_interval: 5s static_configs: - targets: ['App_IP:8080']
  • 24. Prometheus Dashboard 24 Example of metrics on Prometheus dashboard:
  • 25. Prometheus Alerting 25 Alerting is provided by a tool called Alertmanager Alerting rules are defined on the Prometheus server. When the threshold or criteria is met, an alert will be generated and pushed to Alertmanager. The alerts are received on an HTTP endpoint on the Alertmanager. Alertmanager handles deduplicating, grouping, and routing alerts to receivers (e.g. email, SMS, PagerDuty)
  • 26. Prometheus Alerting Configuration 26 A simple alertmanager.yml configuration file, sending alerts by email:
  • 27. Prometheus Alerting Web Interface 27 Web interface to: • view current alerts • manage maintenance window alert suppression (silences)
  • 28. Prometheus Pushgateway 28 Metrics can be pushed to Pushgateway when there isn’t a target from which to scrape metrics because: • can’t reach the target resources because of security • target resource has too short a lifespan (e.g. container starting, executing, and stopping). • target resource doesn’t have an endpoint, (e.g. batch job). Pushgateway sits between an application sending metrics and the Prometheus server. Pushgateway is scraped as a target to deliver the metrics to the Prometheus server.
  • 29. Agenda 29 • Monitoring Concepts • Micrometer • Prometheus • Grafana • Demo
  • 30. Grafana 30 Prometheus UI is not really nice. Alternative: Grafana is open source metrics Dashboard platform. It supports multiple backend time-series databases including: Prometheus , InfluxDB, Elasticsearch, Cloudwatch … Example of Grafana dashboard:
  • 32. Grafana Prometheus as Datasource 32 Before you create your first dashboard you need to add your data source.
  • 33. Grafana Prometheus as Datasource 33 Name: your choice Default: Check to tell Grafana to search for data in this source by default Type: Prometheus URL: URL of the Prometheus server to query.
  • 34. Agenda 34 • Monitoring Concepts • Micrometer • Prometheus • Grafana • Demo
  • 35. References 35 Micrometer: • https://micrometer.io Prometheus • Book: Monitoring with Prometheus, James Turnbull, 2018. • https://prometheus.io Graphana • https://grafana.com/