SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

Más de 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
 

Más de 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
 

Último

AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
SEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization SpecialistSEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization SpecialistKHM Anwar
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 

Último (20)

AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
SEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization SpecialistSEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization Specialist
 
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 

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

Notas del editor

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