SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Distributed Monitoring with MicroProfile
Metrics, PCP and
Prometheus
Werner Keil
JSR 385 Spec Lead
Jakarta EE Specification Committee Member
@wernerkeil
October 10, 2018
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Agenda
1. Introduction
2. Performance Co-Pilot
3. Dropwizard Metrics
4. MicroProfile Metrics
5. Prometheus
6. Demo
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Who am I?
Werner Keil
• Consultant – Coach
• Creative Cosmopolitan
• Open Source Evangelist
• Software Architect
• Spec Lead – JSR385
•Jakarta EE Specification Committee Member
[www.linkedin.com/in/catmedia]
Twitter @wernerkeil
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
What is Monitoring?
Monitoring applications is observing, analyzing and
manipulating the execution of these applications, which gives
information about threads, CPU usage, memory usage, as well
as other information like methods and classes being used.
A particular case is the monitoring of distributed
applications, aka the Cloud where an the performance
analysis of nodes and communication between them pose
additional challenges.
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
A high-level view of Cloud
Monitoring
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Challenges at System Level
• Efficient Scalability
– Supporting tens of thousands of monitoring tasks
– Cost effective: minimize resource usage
• Monitoring QoS
– Multi-tenancy environment
– Minimize resource contention between monitoring tasks
• Implication of Multi-Tenancy
– Monitoring tasks: adding, removing
– Resource contention between monitoring tasks
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Performance vs Number of Hosts
Number of hosts Performance (values per second)
100 100
1000 1000
10000 10000
60 items per host, update frequency once per minute
Number of hosts Performance (values per second)
100 1000
1000 10000
10000 100000
600 items per host, update frequency once per minute
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Monitoring Tips
• Regularly apply “Little’s Law” to all data... generic
(queueing theory) form:
Q = λ R
• Length = Arrival Rate x Response Time
– e.g. 10 MB = 2 MB/sec x 5 sec
• Utilization = Arrival Rate x Service Time
– e.g. 20% = 0.2 = 100 msec/sec x 2 sec
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Types of Monitoring
Monitoring Logs
• Logstash
• Redis
• Elasticsearch
• Kibana Dashboard
Monitoring Performance
• Collectd
• Statsd
• PCP
• Graphite
• Database (eg: PSQL)
• Grafana Dashboard
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Monitoring Logs – Kibana
Dashboard
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Monitoring Performance
How is this traditionally done?
• rsyslog/syslog-ng/journald
• top/iostat/vmstat/ps
• Mixture of scripting languages (bash/perl/python)
• Specific tools vary per platform
• Proper analysis requires more context
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Performance Co-Pilot
PCP
http://www.pcp.io
GitHub
https://github.com/performancecopilot
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
What is PCP?
• Open source toolkit
• System-level analysis
• Live and historical
• Extensible (monitors, collectors)
• Distributed
• Unix-like component design
• Cross platform
• Ubiquitous units of measurement
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Basics
Agents and Daemons
At the core we have two basic
components:
1. Performance Metric
Domain Agents
• Agents
2. Performance Metric
Collection Daemon
• PMCD
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Architecture
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Metrics
• pminfo --desc -tT --fetch disk.dev.read
disk.dev.read [per-disk read operations]
Data Type: 32-bit unsigned int InDom: 60.1
Semantics: counter Units: count
Help: Cumulative count of disk reads since
boot time
Values:
inst [0 or "sda"] value 3382299
inst [1 or "sdb"] value 178421
16
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Agents
Webserver
(apache/nginx)
DBMS
Network
Kernel
PMCD
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Clients
Agents
PMCD
pmie
pmstat
pmval
pminfo
pmchart
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Remote Clients
Agents
PMCD
Clients
Remote
PMCD
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP Data Model
• Metrics come from one source (host / archive)
• Source can be queried at any interval by any monitor tool
• Hierarchical metric names
e.g. disk.dev.read and aconex.response_time.avg
• Metrics are singular or set-valued (“instance domain”)
• Metadata associated with every metric
• Data type (int32, uint64, double, ...)
• Data semantics (units, scale, ...)
• Instance domain
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Performance Timeline
• Where does the time go?
• Where’s it going now?
• Where will it go?
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Performance Timeline – Toolkit
• Archives
• Live Monitoring
• Modelling and statistical
prediction
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Performance Timeline – PCP
Toolkit
• Yesterday, last week, last month, ...
• All starts with pmlogger
• Arbitrary metrics, intervals
• One instance produces one PCP archive for one host
• An archive consists of 3 files
• Metadata, temporal index, data volume(s)
• pmlogger_daily, pmlogger_check
• Ensure the data keeps flowing
• pmlogsummary, pmwtf, pmdumptext
• pmlogextract, pmlogreduce
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Custom Instrumentation
(Applications)
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP – Parfait
Parfait has 4 main parts (for now)
• Monitoring
• DXM
• Timing
• Requests
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Parfait – Monitoring
• This is the ‘original’ PCP bridge metrics (heavily modified)
• Simple Java objects (MonitoredValues) which wrap a value (e.g.
AtomicLong, String)
• MonitoredValues register themselves with a registry (container)
• When values changes, observers notice and output accordingly
• PCP
• JMX
• Other (Custom/Extended)
• Very simple to use
• ‘Default registry’ (legacy concept)
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP – Speed
Golang implementation of the PCP
instrumentation API
There are 3 main components
in the library
• Client
• Registry
• Metric
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
PCP – Speed Metric
• SingletonMetric
• This type defines a metric with no instance domain and only one
value. It requires type, semantics and unit for construction, and
optionally takes a couple of description strings.
A simple construction
metric, err := speed.NewPCPSingletonMetric(
42, // initial value
"simple.counter", // name
speed.Int32Type, // type
speed.CounterSemantics, // semantics
speed.OneUnit, // unit
"A Simple Metric", // short description
"This is a simple counter metric to demonstrate the speed API", // long desc
)
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
What is Metrics?
• Code instrumentation
• Meters
• Gauges
• Counters
• Histograms
• Web app instrumentation
• Web app health check
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Metrics Reporters
• Reporters
• Console
• CSV
• Slf4j
• JMX
• Advanced reporters
• Graphite
• Ganglia
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Metrics 3rd Party Libraries
• AspectJ
• InfluxDB
• StatsD
• Cassandra
• Spring
What is Eclipse MicroProfile?
● Eclipse MicroProfile is an open-source community
specification for Enterprise Java microservices
● A community of individuals, organizations, and vendors
collaborating within an open source (Eclipse) project to
bring microservices to the Enterprise Java community
32
Specifications 2.0
33
MicroProfile 2.0= New
= No change from last release
JAX-RS 2.1JSON-P 1.1CDI 2.0
Config 1.3
Fault
Tolerance
1.1
JWT
Propagation
1.1
Health
Check 1.0
Metrics 1.1
JSON-B 1.0
Annotations
1.3
Open
Tracing 1.1
REST
Client 1.1
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
What is MicroProfile Metrics?
• Code instrumentation
• Meters
• Gauges
• Counters
• Histograms
• Inspired by Dropwizard
• Improved, e.g. by Metadata like PCP
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Metrics Elements
• MetricsRegistry
• A collection of all the metrics for your application
• Usually one instance per JVM
• Use more in multi WAR deployment
• Each metric has a unique name, Registry has helper methods for
names
Metadata md = new MetadataBuilder.withName(“size“) .withUnit(“bytes“).build()
MetricRegistry.meter(md)
}
});
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Metrics Elements (2)
• Gauge
• The simplest metric type: it just returns a value
final Map<String, String> keys = new HashMap<>();
registry.register(MetricRegistry.name ("gauge", "keys"),
new Gauge<Integer>() {
@Override
public Integer getValue() {
return keys.keySet().size();
}
});
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Metrics Elements (3)
• Counter
• Incrementing and decrementing 64.bit integer
final Counter counter=
registry.counter(MetricRegistry.name("counter","inserted"))
counter.inc();
• Meter
• Measures the rate at which a set of events occur
final Meter meter = registry.meter(MetricRegistry.name("meter", "inserted"));
meter.mark();
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
MicroProfile Health Check
• Used to probe the state of a system, not primarily intended as
monitoring for human operators
@Health
public class MyHealthCheck implements HealthCheck {
@Override
public HealthCheckResponse call() {
return HealthCheckResponse.named(
"elvis-has-left-the-building").up().withData("it's",
"true").build();
}
}
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Prometheus
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
What is Prometheus?
Prometheus is an open-source systems monitoring
and alerting toolkit originally
built at SoundCloud. It is now a standalone open
source project and maintained
independently of any company.
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Prometheus Features
• Multi-dimensional data model with time series and metrics identified by
name and key/value pairs
• Flexible query language
• No dependency on distributed storage. Single server nodes are
autonomous
• Time series collection happens via HTTP pull
• Pushing time series via an intermediary gateway
• Targets discovered by service discovery or static configuration
• Multiple graph and dashboard modes
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Prometheus Components
• The main Prometheus server which scrapes and stores time series data
• Client libraries for instrumenting application code
• A push gateway for supporting short-lived jobs
• Special-purpose exporters (for HAProxy, StatsD, Graphite, etc.)
• An alertmanager
• Various support tools
• WhiteBox Monitoring instead of probing (aka BlackBox Monitoring)
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Prometheus Architecture
@YourTwitterHandle#DVXFR14{session hashtag} © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Images: Nu Image / Millennium Films
© 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus
Links
Performance Co-Pilot
http://www.pcp.io
Dropwizard Metrics
http://metrics.dropwizard.io
Eclipse MicroProfile
http://microprofile.io
Prometheus
http://prometheus.io
Java EE 8 High Performance [Video]
https://www.packtpub.com/application-development/java-ee-8-high-
performance-video
@YourTwitterHandle#DVXFR14{session hashtag} © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus

Weitere ähnliche Inhalte

Mehr von Werner Keil

Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)Werner Keil
 
NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)Werner Keil
 
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR DayHow JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR DayWerner Keil
 
JNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL DatabasesJNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL DatabasesWerner Keil
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabasesEclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabasesWerner Keil
 
Physikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG MunichPhysikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG MunichWerner Keil
 
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017Werner Keil
 
Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017Werner Keil
 
Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363Werner Keil
 
Java2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudWerner Keil
 
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ StuttgartApache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ StuttgartWerner Keil
 
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-BrandenburgThe First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-BrandenburgWerner Keil
 
JSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short OverviewJSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short OverviewWerner Keil
 
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit AgoravaJavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit AgoravaWerner Keil
 
Enterprise 2.0 with Open Source Frameworks like Agorava
Enterprise 2.0 with Open Source Frameworks like AgoravaEnterprise 2.0 with Open Source Frameworks like Agorava
Enterprise 2.0 with Open Source Frameworks like AgoravaWerner Keil
 
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015Werner Keil
 
The First IoT JSR: Units of Measurement - DevoXX BE 2015
The First IoT JSR: Units of Measurement - DevoXX BE 2015The First IoT JSR: Units of Measurement - DevoXX BE 2015
The First IoT JSR: Units of Measurement - DevoXX BE 2015Werner Keil
 
Apache DeviceMap - ApacheCon core Europe 2015
Apache DeviceMap - ApacheCon core Europe 2015Apache DeviceMap - ApacheCon core Europe 2015
Apache DeviceMap - ApacheCon core Europe 2015Werner Keil
 
Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...
Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...
Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...Werner Keil
 
Apache DeviceMap - codemotion Rome 2015
Apache DeviceMap - codemotion Rome 2015Apache DeviceMap - codemotion Rome 2015
Apache DeviceMap - codemotion Rome 2015Werner Keil
 

Mehr von Werner Keil (20)

Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)
 
NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)
 
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR DayHow JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
 
JNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL DatabasesJNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL Databases
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabasesEclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
 
Physikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG MunichPhysikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG Munich
 
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
 
Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017
 
Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363
 
Java2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the Cloud
 
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ StuttgartApache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ Stuttgart
 
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-BrandenburgThe First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
 
JSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short OverviewJSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short Overview
 
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit AgoravaJavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
 
Enterprise 2.0 with Open Source Frameworks like Agorava
Enterprise 2.0 with Open Source Frameworks like AgoravaEnterprise 2.0 with Open Source Frameworks like Agorava
Enterprise 2.0 with Open Source Frameworks like Agorava
 
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
 
The First IoT JSR: Units of Measurement - DevoXX BE 2015
The First IoT JSR: Units of Measurement - DevoXX BE 2015The First IoT JSR: Units of Measurement - DevoXX BE 2015
The First IoT JSR: Units of Measurement - DevoXX BE 2015
 
Apache DeviceMap - ApacheCon core Europe 2015
Apache DeviceMap - ApacheCon core Europe 2015Apache DeviceMap - ApacheCon core Europe 2015
Apache DeviceMap - ApacheCon core Europe 2015
 
Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...
Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...
Data Quality on Mars - ISO 80000 and other Standards - Apache Big Data Europe...
 
Apache DeviceMap - codemotion Rome 2015
Apache DeviceMap - codemotion Rome 2015Apache DeviceMap - codemotion Rome 2015
Apache DeviceMap - codemotion Rome 2015
 

Kürzlich hochgeladen

Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsMonica Sydney
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsPriya Reddy
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...kumargunjan9515
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 

Kürzlich hochgeladen (20)

call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 

Distributed Monitoring with MicroProfile Metrics, PCP and Prometheus

  • 1. Distributed Monitoring with MicroProfile Metrics, PCP and Prometheus Werner Keil JSR 385 Spec Lead Jakarta EE Specification Committee Member @wernerkeil October 10, 2018
  • 2. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Agenda 1. Introduction 2. Performance Co-Pilot 3. Dropwizard Metrics 4. MicroProfile Metrics 5. Prometheus 6. Demo
  • 3. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Who am I? Werner Keil • Consultant – Coach • Creative Cosmopolitan • Open Source Evangelist • Software Architect • Spec Lead – JSR385 •Jakarta EE Specification Committee Member [www.linkedin.com/in/catmedia] Twitter @wernerkeil
  • 4. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus What is Monitoring? Monitoring applications is observing, analyzing and manipulating the execution of these applications, which gives information about threads, CPU usage, memory usage, as well as other information like methods and classes being used. A particular case is the monitoring of distributed applications, aka the Cloud where an the performance analysis of nodes and communication between them pose additional challenges.
  • 5. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus A high-level view of Cloud Monitoring
  • 6. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Challenges at System Level • Efficient Scalability – Supporting tens of thousands of monitoring tasks – Cost effective: minimize resource usage • Monitoring QoS – Multi-tenancy environment – Minimize resource contention between monitoring tasks • Implication of Multi-Tenancy – Monitoring tasks: adding, removing – Resource contention between monitoring tasks
  • 7. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Performance vs Number of Hosts Number of hosts Performance (values per second) 100 100 1000 1000 10000 10000 60 items per host, update frequency once per minute Number of hosts Performance (values per second) 100 1000 1000 10000 10000 100000 600 items per host, update frequency once per minute
  • 8. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Monitoring Tips • Regularly apply “Little’s Law” to all data... generic (queueing theory) form: Q = λ R • Length = Arrival Rate x Response Time – e.g. 10 MB = 2 MB/sec x 5 sec • Utilization = Arrival Rate x Service Time – e.g. 20% = 0.2 = 100 msec/sec x 2 sec
  • 9. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Types of Monitoring Monitoring Logs • Logstash • Redis • Elasticsearch • Kibana Dashboard Monitoring Performance • Collectd • Statsd • PCP • Graphite • Database (eg: PSQL) • Grafana Dashboard
  • 10. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Monitoring Logs – Kibana Dashboard
  • 11. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Monitoring Performance How is this traditionally done? • rsyslog/syslog-ng/journald • top/iostat/vmstat/ps • Mixture of scripting languages (bash/perl/python) • Specific tools vary per platform • Proper analysis requires more context
  • 12. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Performance Co-Pilot PCP http://www.pcp.io GitHub https://github.com/performancecopilot
  • 13. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus What is PCP? • Open source toolkit • System-level analysis • Live and historical • Extensible (monitors, collectors) • Distributed • Unix-like component design • Cross platform • Ubiquitous units of measurement
  • 14. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Basics Agents and Daemons At the core we have two basic components: 1. Performance Metric Domain Agents • Agents 2. Performance Metric Collection Daemon • PMCD
  • 15. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Architecture
  • 16. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Metrics • pminfo --desc -tT --fetch disk.dev.read disk.dev.read [per-disk read operations] Data Type: 32-bit unsigned int InDom: 60.1 Semantics: counter Units: count Help: Cumulative count of disk reads since boot time Values: inst [0 or "sda"] value 3382299 inst [1 or "sdb"] value 178421 16
  • 17. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Agents Webserver (apache/nginx) DBMS Network Kernel PMCD
  • 18. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Clients Agents PMCD pmie pmstat pmval pminfo pmchart
  • 19. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Remote Clients Agents PMCD Clients Remote PMCD
  • 20. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP Data Model • Metrics come from one source (host / archive) • Source can be queried at any interval by any monitor tool • Hierarchical metric names e.g. disk.dev.read and aconex.response_time.avg • Metrics are singular or set-valued (“instance domain”) • Metadata associated with every metric • Data type (int32, uint64, double, ...) • Data semantics (units, scale, ...) • Instance domain
  • 21. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Performance Timeline • Where does the time go? • Where’s it going now? • Where will it go?
  • 22. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Performance Timeline – Toolkit • Archives • Live Monitoring • Modelling and statistical prediction
  • 23. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Performance Timeline – PCP Toolkit • Yesterday, last week, last month, ... • All starts with pmlogger • Arbitrary metrics, intervals • One instance produces one PCP archive for one host • An archive consists of 3 files • Metadata, temporal index, data volume(s) • pmlogger_daily, pmlogger_check • Ensure the data keeps flowing • pmlogsummary, pmwtf, pmdumptext • pmlogextract, pmlogreduce
  • 24. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Custom Instrumentation (Applications)
  • 25. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP – Parfait Parfait has 4 main parts (for now) • Monitoring • DXM • Timing • Requests
  • 26. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Parfait – Monitoring • This is the ‘original’ PCP bridge metrics (heavily modified) • Simple Java objects (MonitoredValues) which wrap a value (e.g. AtomicLong, String) • MonitoredValues register themselves with a registry (container) • When values changes, observers notice and output accordingly • PCP • JMX • Other (Custom/Extended) • Very simple to use • ‘Default registry’ (legacy concept)
  • 27. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP – Speed Golang implementation of the PCP instrumentation API There are 3 main components in the library • Client • Registry • Metric
  • 28. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus PCP – Speed Metric • SingletonMetric • This type defines a metric with no instance domain and only one value. It requires type, semantics and unit for construction, and optionally takes a couple of description strings. A simple construction metric, err := speed.NewPCPSingletonMetric( 42, // initial value "simple.counter", // name speed.Int32Type, // type speed.CounterSemantics, // semantics speed.OneUnit, // unit "A Simple Metric", // short description "This is a simple counter metric to demonstrate the speed API", // long desc )
  • 29. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus What is Metrics? • Code instrumentation • Meters • Gauges • Counters • Histograms • Web app instrumentation • Web app health check
  • 30. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Metrics Reporters • Reporters • Console • CSV • Slf4j • JMX • Advanced reporters • Graphite • Ganglia
  • 31. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Metrics 3rd Party Libraries • AspectJ • InfluxDB • StatsD • Cassandra • Spring
  • 32. What is Eclipse MicroProfile? ● Eclipse MicroProfile is an open-source community specification for Enterprise Java microservices ● A community of individuals, organizations, and vendors collaborating within an open source (Eclipse) project to bring microservices to the Enterprise Java community 32
  • 33. Specifications 2.0 33 MicroProfile 2.0= New = No change from last release JAX-RS 2.1JSON-P 1.1CDI 2.0 Config 1.3 Fault Tolerance 1.1 JWT Propagation 1.1 Health Check 1.0 Metrics 1.1 JSON-B 1.0 Annotations 1.3 Open Tracing 1.1 REST Client 1.1
  • 34. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus What is MicroProfile Metrics? • Code instrumentation • Meters • Gauges • Counters • Histograms • Inspired by Dropwizard • Improved, e.g. by Metadata like PCP
  • 35. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Metrics Elements • MetricsRegistry • A collection of all the metrics for your application • Usually one instance per JVM • Use more in multi WAR deployment • Each metric has a unique name, Registry has helper methods for names Metadata md = new MetadataBuilder.withName(“size“) .withUnit(“bytes“).build() MetricRegistry.meter(md) } });
  • 36. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Metrics Elements (2) • Gauge • The simplest metric type: it just returns a value final Map<String, String> keys = new HashMap<>(); registry.register(MetricRegistry.name ("gauge", "keys"), new Gauge<Integer>() { @Override public Integer getValue() { return keys.keySet().size(); } });
  • 37. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Metrics Elements (3) • Counter • Incrementing and decrementing 64.bit integer final Counter counter= registry.counter(MetricRegistry.name("counter","inserted")) counter.inc(); • Meter • Measures the rate at which a set of events occur final Meter meter = registry.meter(MetricRegistry.name("meter", "inserted")); meter.mark();
  • 38. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus MicroProfile Health Check • Used to probe the state of a system, not primarily intended as monitoring for human operators @Health public class MyHealthCheck implements HealthCheck { @Override public HealthCheckResponse call() { return HealthCheckResponse.named( "elvis-has-left-the-building").up().withData("it's", "true").build(); } }
  • 39. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Prometheus
  • 40. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus What is Prometheus? Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. It is now a standalone open source project and maintained independently of any company.
  • 41. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Prometheus Features • Multi-dimensional data model with time series and metrics identified by name and key/value pairs • Flexible query language • No dependency on distributed storage. Single server nodes are autonomous • Time series collection happens via HTTP pull • Pushing time series via an intermediary gateway • Targets discovered by service discovery or static configuration • Multiple graph and dashboard modes
  • 42. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Prometheus Components • The main Prometheus server which scrapes and stores time series data • Client libraries for instrumenting application code • A push gateway for supporting short-lived jobs • Special-purpose exporters (for HAProxy, StatsD, Graphite, etc.) • An alertmanager • Various support tools • WhiteBox Monitoring instead of probing (aka BlackBox Monitoring)
  • 43. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Prometheus Architecture
  • 44. @YourTwitterHandle#DVXFR14{session hashtag} © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Images: Nu Image / Millennium Films
  • 45. © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus Links Performance Co-Pilot http://www.pcp.io Dropwizard Metrics http://metrics.dropwizard.io Eclipse MicroProfile http://microprofile.io Prometheus http://prometheus.io Java EE 8 High Performance [Video] https://www.packtpub.com/application-development/java-ee-8-high- performance-video
  • 46. @YourTwitterHandle#DVXFR14{session hashtag} © 2018 Creative Arts & Technologies and others. All rights reserved.#Monitoring #PerformanceCoPilot #MicroProfile #Prometheus

Hinweis der Redaktion

  1. Config 1.1 introduces minor (documentation) changes to Config 1.0