SlideShare a Scribd company logo
1 of 45
Monitoring 101
Leverage on the Power of JMX
... and beyond
Martin Gutenbrunner
Dynatrace InnovationLab
@MartinGoodwell
Java Forum Stuttgart, July 7 #jfs2016
@MartinGoodwell
About me
 Started with Commodore 8-bit (VC-20 and C-64)
 Built Null-Modem connections for playing Doom and WarCraft I
 Went on to IPX/SPX networks between MS-DOS 6.22 and
WfW 3.11
 Did DevOps before it was a thing (mainly Java and Web)
for ~ 10 years
 Now at Dynatrace Innovation Lab
 Find me on Twitter: @MartinGoodwell
 Austria
Passionate about life,
technology, and the people
behind both of them.
@MartinGoodwell
Monitoring 101
Leverage on the Power of JMX
... and beyond
1
Agenda
2
3
@MartinGoodwell
Warm up
 Please, feel free to ask and interrupt anytime
 This is about you, after all
 How many developers, operators and business people are here?
 I love Java and Spring Framework
 Anyone here who hates one of them?
 Any previous experience with JMX or monitoring, anyone?
 Who knows what APM is?
@MartinGoodwell
Monitoring
... your application, not your environment
@MartinGoodwell
Why monitoring, when we can debug?
 Debugging is for Developers only
 Operations need monitoring
 Monitoring can be done via web apps
 Debugging requires a dev-env to be setup
 Monitoring is about two things
 Tracking problems
 Optimizing performance
 More often than not, those two things will be based on production data
 Plus: when you can track errors, you can also track business
@MartinGoodwell
Active vs passive approach
Two ways of thinking, two ways of integrating
@MartinGoodwell
Active
 JMX is an active way of monitoring
 You need to know, which metrics you want to monitor
 And actively publish/export them
 Pro
 You can monitor all the metrics you want, even those specific to your application
 Con
 Pollutes your code
 But there‘s ways around that, like AOP
@MartinGoodwell
Passive
 As opposed to passive monitoring
 Where tools automatically pick up the most common metrics, like
 Number of requests
 Round-trip times
 HTTP status codes
 by eg. AOP or Java agent interface
 I.e. without actively integrating monitoring code into your business logic
 Pro:
 No code pollution
 Con
 Only collects technology-related metrics (nr of requests, ...), no business metrics (like nr of orders)
@MartinGoodwell
JMX
A short introduction
@MartinGoodwell
JMX Trivia
 Java Management Extensions
 Counters, gauges and strings
 JMX is ooold:
 Integral part of Java since Java 5
 MBeans can consist of
 Readable/writable attributes (right, not only for reading values)
 Invokable operations (I am not really in favor of those)
 A description (rules of proper documentation apply)
@MartinGoodwell
Standard, Dynamic, Model, Open, MX
 MBean
 Static
 Dynamic
 ModelMBean (configurable)
 OpenMBean (specific data-types)
 MXBean (came with Java 6)
 XMBean is not an MXBean with a typo
 XMBean is a JBoss-specific MBean
 Bottomline: use MXBean
@MartinGoodwell
Why JMX?
 For Ops:
 Because most Java services / apps provide JMX metrics. You get it „for free“
 For Devs:
 It‘s not too hard to implement, even really easy with eg. Spring Framework
 For DevOps (ie both):
 Lots of visualization tools available, both free and commercial
 It‘s a unified way of monitoring (no matter whether it‘s a queue, a database or a
cache)
 For Business:
 It allows your devs to provide and your ops to report the metrics you need.
@MartinGoodwell
Which metrics should I monitor?
 Common process metrics
 CPU
 Memory
 Service specific metrics
 Webservers: Nr of requests and response times
 Databases: Connection pools utilization, etc.
 Caches: hits and misses
 Queues: size, fill-rate
 Business Intelligence
 Visitors
 Orders
@MartinGoodwell
Who provides JMX metrics out-of-the-box?
 JVM
 Threading, Memory usage, Garbage Collection, CPU usage (system, process, …)
 Web Servers
 Tomcat
 Jetty
 Netflix OSS
 Eureka Discovery Server
 Hystrix Circuit Breaker
 Connection Pools
 RDBMS (Tomcat DBCP, c3p0, BoneCP, HikariCP, …)
 MongoDB
 Messaging Queues (ie JMS)
 HornetQ
 Active MQ
@MartinGoodwell
... Wait, there‘s still more!
 Hibernate
 Spring
 Adds JMX to most libraries it wraps
 Quartz (the scheduler)
 EhCache (the cache)
@MartinGoodwell
Some examples
@MartinGoodwell
Java JMX
@MartinGoodwell
Tomcat JMX
@MartinGoodwell
MongoDB JMX
@MartinGoodwell
HornetQ
@MartinGoodwell
Business metrics
 Feature usage
 Number of placed orders
 Where do my customers come from?
 Track a customer‘s path:
 Catalog
 Shopping Cart
 Checkout
 Payment
 Dropouts
@MartinGoodwell
Correlating metrics
 On a technical basis
 Nr of requests vs response time
 Increasing response time alongside increasing number of requests probably pinpoints a
scalability problem
 The real fun starts when you correlate BI with technical metrics
 Eg. Feature usage vs error rate or response times
 Increasing errors in service X
 And decreasing usage of feature A at the same time
 There seems to be a relation
 Order rate vs response time?
@MartinGoodwell
Correlating Business and Tech
 Any error count makes a great candidate for correlation with most metrics
@MartinGoodwell
Build 17 testNewsAlert OK
testSearch OK
Build # Use Case Stat # API Calls # SQL Payload CPU
1 5 2kb 70ms
1 3 5kb 120ms
Tests Metrics
Build 26 testNewsAlert OK
testSearch OK
Build 25 testNewsAlert OK
testSearch OK
1 4 1kb 60ms
34 171 104kb 550ms
Ops
#ServInst Usage RT
1 0.5% 7.2s
1 63% 5.2s
1 4 1kb 60ms
2 3 10kb 150ms
1 0.2% 5.2s
5 75% 2.5s
Build 35 testNewsAlert -
testSearch OK
- - - -
2 3 10kb 150ms
- - -
8 80% 2.0s
Metrics from and for Dev(to)Ops
Re-architecture -> Performance Fixes
@MartinGoodwell
How to export your own metrics
For Ops: How to tell your Devs how to export their own metrics
@MartinGoodwell
By Donsez - self-made, CC BY-SA 3.0, https://en.wikipedia.org/w/index.php?curid=6721989
@MartinGoodwell
Vanilla JMX
https://docs.oracle.com/javase/tutorial/jmx/mbeans/standard.html
@MartinGoodwellhttps://docs.oracle.com/javase/tutorial/jmx/mbeans/standard.html
@MartinGoodwell
https://docs.oracle.com/javase/tutorial/jmx/mbeans/standard.html
@MartinGoodwell
JMX with Spring Boot
 Spring simplifies JMX by
 creating an MBean server automatically (as does eg Tomcat)
 less boilerplate code for registering your own MBeans
@MartinGoodwell
@MartinGoodwell
JMX Tools
@MartinGoodwell
JConsole, JVisualVM
 Pro
 Comes with JVM
 Con
 Once you quit, all data is lost
@MartinGoodwell
Nagios Core
 Pro
 Allows you to combine all different types of
metrics
 Host
 Application
 Con
 Very tedious to setup
 Dedicated plugins for each technology
@MartinGoodwell
Dynatrace
 Allows you to combine all different types of
metrics
 Host
 Application
 Zero-conf, auto-detection
@MartinGoodwell
Bridges (eg JMX to HTTP)
https://jolokia.org/reference/html/protocol.html
@MartinGoodwell
Downsides of JMX
 For Java code only
 Finding the right spots for monitoring might require some iterations
 Potential source of „Hell Breaks Loose“
 Triggering methods out of context
 Changing configuration values in-memory only
@MartinGoodwell
Alternatives?
@MartinGoodwell
statsd real quick
http://www.slideshare.net/DatadogSlides/dev-opsdays-tokyo2013effectivestatsdmonitoring
@MartinGoodwell
@MartinGoodwell
Java code calling statsd client
http://rick-hightower.blogspot.co.uk/2015/05/working-with-statsd-and-java.html
@MartinGoodwell
Why JMX over other alternatives?
 You might be using it already for JVM-metrics (or Tomcat, etc)
 GC, CPU-usage, requests, etc
 While still „polluting“ your code, interfaces allow for good structures
 Allows to interact with the application (although I wouldn‘t recommend this)
 Notifications on a code-level
(https://docs.oracle.com/javase/tutorial/jmx/notifs/index.html)
 Comes with JVM – saves you from bloating small solutions with dependencies
@MartinGoodwell
Shout out
Right after lunch break at 14.30
In Room Silcher-Saal
@MartinGoodwell
“Go then, there are other worlds than these.”
— Jake Chambers, The Dark Tower
martin.gutenbrunner@dynatrace.com
@MartinGoodwell
Dynatrace Innovation Lab
http://blog.ruxit.com
http://www.dynatrace.com
@MartinGoodwell
References
 JMX-Technology homepage
 http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html
 Monitoring and Managing the Java Platform using JMX technology
 https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html
 Call-tracing and performance management in microservice environments
 http://www.slideshare.net/MartinGoodwell/performance-monitoring-and-call-tracing-in-
microservice-environments
 Jolokia https://jolokia.org/
 Nagios https://www.nagios.org/
 statsd https://github.com/etsy/statsd/wiki
 Sleepless Dev http://rick-hightower.blogspot.co.uk

More Related Content

What's hot

PRMA - Introduction
PRMA - IntroductionPRMA - Introduction
PRMA - IntroductionBowen Cai
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Asynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringAsynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringNaresh Chintalcheru
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGPablo Garbossa
 
PGEncryption_Tutorial
PGEncryption_TutorialPGEncryption_Tutorial
PGEncryption_TutorialVibhor Kumar
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & ProfilingIsuru Perera
 
Transactional File System In Java - Commons Transaction
Transactional File System In Java - Commons TransactionTransactional File System In Java - Commons Transaction
Transactional File System In Java - Commons TransactionGuo Albert
 
Do it Yourself Testing
Do it Yourself TestingDo it Yourself Testing
Do it Yourself TestingEmily Stolfo
 
Create simple api using node js
Create simple api using node jsCreate simple api using node js
Create simple api using node jsEdwin Andrianto
 
Webhosting on IPv6-only Virtual Machines
Webhosting on IPv6-only Virtual Machines Webhosting on IPv6-only Virtual Machines
Webhosting on IPv6-only Virtual Machines punkt.de GmbH
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)iFour Technolab Pvt. Ltd.
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?Ovidiu Dimulescu
 

What's hot (19)

PRMA - Introduction
PRMA - IntroductionPRMA - Introduction
PRMA - Introduction
 
Load balancing at tuenti
Load balancing at tuentiLoad balancing at tuenti
Load balancing at tuenti
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Asynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringAsynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/Spring
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Transactions
TransactionsTransactions
Transactions
 
PGEncryption_Tutorial
PGEncryption_TutorialPGEncryption_Tutorial
PGEncryption_Tutorial
 
Topology backend using kafka
Topology backend using kafkaTopology backend using kafka
Topology backend using kafka
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Transactional File System In Java - Commons Transaction
Transactional File System In Java - Commons TransactionTransactional File System In Java - Commons Transaction
Transactional File System In Java - Commons Transaction
 
Do it Yourself Testing
Do it Yourself TestingDo it Yourself Testing
Do it Yourself Testing
 
Create simple api using node js
Create simple api using node jsCreate simple api using node js
Create simple api using node js
 
Webhosting on IPv6-only Virtual Machines
Webhosting on IPv6-only Virtual Machines Webhosting on IPv6-only Virtual Machines
Webhosting on IPv6-only Virtual Machines
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?
 
Gatling
GatlingGatling
Gatling
 

Viewers also liked

Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)roland.huss
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
Java management extensions (jmx)
Java management extensions (jmx)Java management extensions (jmx)
Java management extensions (jmx)Tarun Telang
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)roland.huss
 
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamicsMonitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamicsNima Badiey
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
fabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftfabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftroland.huss
 

Viewers also liked (10)

Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)Jolokia - JMX on Capsaicin (Devoxx 2011)
Jolokia - JMX on Capsaicin (Devoxx 2011)
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
Java management extensions (jmx)
Java management extensions (jmx)Java management extensions (jmx)
Java management extensions (jmx)
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)
 
JMX Tutorial
JMX TutorialJMX Tutorial
JMX Tutorial
 
JMX Introduction
JMX IntroductionJMX Introduction
JMX Introduction
 
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamicsMonitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
Monitoring Cloud Native Apps on Pivotal Cloud Foundry with AppDynamics
 
Elk stack
Elk stackElk stack
Elk stack
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
fabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftfabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShift
 

Similar to Monitoring 101 - Leveraging on the power of JMX

Performance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environmentsPerformance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environmentsMartin Gutenbrunner
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009ken.egozi
 
20061122 JBoss-World Experiences with JBoss jBPM
20061122 JBoss-World Experiences with JBoss jBPM20061122 JBoss-World Experiences with JBoss jBPM
20061122 JBoss-World Experiences with JBoss jBPMcamunda services GmbH
 
Web Machine Learning (ML) API POC march update
Web Machine Learning (ML) API POC march updateWeb Machine Learning (ML) API POC march update
Web Machine Learning (ML) API POC march updatehuningxin
 
Pareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo CollinaPareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo CollinaWey Wey Web
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbsvarien
 
Usemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual MachinveUsemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual MachinvePaul René Jørgensen
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyBrian Lyttle
 
StackOverflow Architectural Overview
StackOverflow Architectural OverviewStackOverflow Architectural Overview
StackOverflow Architectural OverviewFolio3 Software
 
Would Mr. Spok choose Open Source
Would Mr. Spok choose Open SourceWould Mr. Spok choose Open Source
Would Mr. Spok choose Open Sourcevlcinsky
 
A New Transactional Model - Keith Bostic
A New Transactional Model - Keith BosticA New Transactional Model - Keith Bostic
A New Transactional Model - Keith BosticMongoDB
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Fwdays
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to MicroservicesAd van der Veer
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedNoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedLa FeWeb
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - DetroitMartin Gutenbrunner
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesHadi Ariawan
 

Similar to Monitoring 101 - Leveraging on the power of JMX (20)

Performance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environmentsPerformance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environments
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
 
20061122 JBoss-World Experiences with JBoss jBPM
20061122 JBoss-World Experiences with JBoss jBPM20061122 JBoss-World Experiences with JBoss jBPM
20061122 JBoss-World Experiences with JBoss jBPM
 
Web Machine Learning (ML) API POC march update
Web Machine Learning (ML) API POC march updateWeb Machine Learning (ML) API POC march update
Web Machine Learning (ML) API POC march update
 
Pareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo CollinaPareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo Collina
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbs
 
Usemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual MachinveUsemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual Machinve
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
 
StackOverflow Architectural Overview
StackOverflow Architectural OverviewStackOverflow Architectural Overview
StackOverflow Architectural Overview
 
Would Mr. Spok choose Open Source
Would Mr. Spok choose Open SourceWould Mr. Spok choose Open Source
Would Mr. Spok choose Open Source
 
A New Transactional Model - Keith Bostic
A New Transactional Model - Keith BosticA New Transactional Model - Keith Bostic
A New Transactional Model - Keith Bostic
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to Microservices
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedNoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learned
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - Detroit
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
 
Build 2019 Recap
Build 2019 RecapBuild 2019 Recap
Build 2019 Recap
 
.net Framework
.net Framework.net Framework
.net Framework
 

Recently uploaded

Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Recently uploaded (20)

Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

Monitoring 101 - Leveraging on the power of JMX

  • 1. Monitoring 101 Leverage on the Power of JMX ... and beyond Martin Gutenbrunner Dynatrace InnovationLab @MartinGoodwell Java Forum Stuttgart, July 7 #jfs2016
  • 2. @MartinGoodwell About me  Started with Commodore 8-bit (VC-20 and C-64)  Built Null-Modem connections for playing Doom and WarCraft I  Went on to IPX/SPX networks between MS-DOS 6.22 and WfW 3.11  Did DevOps before it was a thing (mainly Java and Web) for ~ 10 years  Now at Dynatrace Innovation Lab  Find me on Twitter: @MartinGoodwell  Austria Passionate about life, technology, and the people behind both of them.
  • 3. @MartinGoodwell Monitoring 101 Leverage on the Power of JMX ... and beyond 1 Agenda 2 3
  • 4. @MartinGoodwell Warm up  Please, feel free to ask and interrupt anytime  This is about you, after all  How many developers, operators and business people are here?  I love Java and Spring Framework  Anyone here who hates one of them?  Any previous experience with JMX or monitoring, anyone?  Who knows what APM is?
  • 6. @MartinGoodwell Why monitoring, when we can debug?  Debugging is for Developers only  Operations need monitoring  Monitoring can be done via web apps  Debugging requires a dev-env to be setup  Monitoring is about two things  Tracking problems  Optimizing performance  More often than not, those two things will be based on production data  Plus: when you can track errors, you can also track business
  • 7. @MartinGoodwell Active vs passive approach Two ways of thinking, two ways of integrating
  • 8. @MartinGoodwell Active  JMX is an active way of monitoring  You need to know, which metrics you want to monitor  And actively publish/export them  Pro  You can monitor all the metrics you want, even those specific to your application  Con  Pollutes your code  But there‘s ways around that, like AOP
  • 9. @MartinGoodwell Passive  As opposed to passive monitoring  Where tools automatically pick up the most common metrics, like  Number of requests  Round-trip times  HTTP status codes  by eg. AOP or Java agent interface  I.e. without actively integrating monitoring code into your business logic  Pro:  No code pollution  Con  Only collects technology-related metrics (nr of requests, ...), no business metrics (like nr of orders)
  • 11. @MartinGoodwell JMX Trivia  Java Management Extensions  Counters, gauges and strings  JMX is ooold:  Integral part of Java since Java 5  MBeans can consist of  Readable/writable attributes (right, not only for reading values)  Invokable operations (I am not really in favor of those)  A description (rules of proper documentation apply)
  • 12. @MartinGoodwell Standard, Dynamic, Model, Open, MX  MBean  Static  Dynamic  ModelMBean (configurable)  OpenMBean (specific data-types)  MXBean (came with Java 6)  XMBean is not an MXBean with a typo  XMBean is a JBoss-specific MBean  Bottomline: use MXBean
  • 13. @MartinGoodwell Why JMX?  For Ops:  Because most Java services / apps provide JMX metrics. You get it „for free“  For Devs:  It‘s not too hard to implement, even really easy with eg. Spring Framework  For DevOps (ie both):  Lots of visualization tools available, both free and commercial  It‘s a unified way of monitoring (no matter whether it‘s a queue, a database or a cache)  For Business:  It allows your devs to provide and your ops to report the metrics you need.
  • 14. @MartinGoodwell Which metrics should I monitor?  Common process metrics  CPU  Memory  Service specific metrics  Webservers: Nr of requests and response times  Databases: Connection pools utilization, etc.  Caches: hits and misses  Queues: size, fill-rate  Business Intelligence  Visitors  Orders
  • 15. @MartinGoodwell Who provides JMX metrics out-of-the-box?  JVM  Threading, Memory usage, Garbage Collection, CPU usage (system, process, …)  Web Servers  Tomcat  Jetty  Netflix OSS  Eureka Discovery Server  Hystrix Circuit Breaker  Connection Pools  RDBMS (Tomcat DBCP, c3p0, BoneCP, HikariCP, …)  MongoDB  Messaging Queues (ie JMS)  HornetQ  Active MQ
  • 16. @MartinGoodwell ... Wait, there‘s still more!  Hibernate  Spring  Adds JMX to most libraries it wraps  Quartz (the scheduler)  EhCache (the cache)
  • 22. @MartinGoodwell Business metrics  Feature usage  Number of placed orders  Where do my customers come from?  Track a customer‘s path:  Catalog  Shopping Cart  Checkout  Payment  Dropouts
  • 23. @MartinGoodwell Correlating metrics  On a technical basis  Nr of requests vs response time  Increasing response time alongside increasing number of requests probably pinpoints a scalability problem  The real fun starts when you correlate BI with technical metrics  Eg. Feature usage vs error rate or response times  Increasing errors in service X  And decreasing usage of feature A at the same time  There seems to be a relation  Order rate vs response time?
  • 24. @MartinGoodwell Correlating Business and Tech  Any error count makes a great candidate for correlation with most metrics
  • 25. @MartinGoodwell Build 17 testNewsAlert OK testSearch OK Build # Use Case Stat # API Calls # SQL Payload CPU 1 5 2kb 70ms 1 3 5kb 120ms Tests Metrics Build 26 testNewsAlert OK testSearch OK Build 25 testNewsAlert OK testSearch OK 1 4 1kb 60ms 34 171 104kb 550ms Ops #ServInst Usage RT 1 0.5% 7.2s 1 63% 5.2s 1 4 1kb 60ms 2 3 10kb 150ms 1 0.2% 5.2s 5 75% 2.5s Build 35 testNewsAlert - testSearch OK - - - - 2 3 10kb 150ms - - - 8 80% 2.0s Metrics from and for Dev(to)Ops Re-architecture -> Performance Fixes
  • 26. @MartinGoodwell How to export your own metrics For Ops: How to tell your Devs how to export their own metrics
  • 27. @MartinGoodwell By Donsez - self-made, CC BY-SA 3.0, https://en.wikipedia.org/w/index.php?curid=6721989
  • 31. @MartinGoodwell JMX with Spring Boot  Spring simplifies JMX by  creating an MBean server automatically (as does eg Tomcat)  less boilerplate code for registering your own MBeans
  • 34. @MartinGoodwell JConsole, JVisualVM  Pro  Comes with JVM  Con  Once you quit, all data is lost
  • 35. @MartinGoodwell Nagios Core  Pro  Allows you to combine all different types of metrics  Host  Application  Con  Very tedious to setup  Dedicated plugins for each technology
  • 36. @MartinGoodwell Dynatrace  Allows you to combine all different types of metrics  Host  Application  Zero-conf, auto-detection
  • 37. @MartinGoodwell Bridges (eg JMX to HTTP) https://jolokia.org/reference/html/protocol.html
  • 38. @MartinGoodwell Downsides of JMX  For Java code only  Finding the right spots for monitoring might require some iterations  Potential source of „Hell Breaks Loose“  Triggering methods out of context  Changing configuration values in-memory only
  • 41. @MartinGoodwell Java code calling statsd client http://rick-hightower.blogspot.co.uk/2015/05/working-with-statsd-and-java.html
  • 42. @MartinGoodwell Why JMX over other alternatives?  You might be using it already for JVM-metrics (or Tomcat, etc)  GC, CPU-usage, requests, etc  While still „polluting“ your code, interfaces allow for good structures  Allows to interact with the application (although I wouldn‘t recommend this)  Notifications on a code-level (https://docs.oracle.com/javase/tutorial/jmx/notifs/index.html)  Comes with JVM – saves you from bloating small solutions with dependencies
  • 43. @MartinGoodwell Shout out Right after lunch break at 14.30 In Room Silcher-Saal
  • 44. @MartinGoodwell “Go then, there are other worlds than these.” — Jake Chambers, The Dark Tower martin.gutenbrunner@dynatrace.com @MartinGoodwell Dynatrace Innovation Lab http://blog.ruxit.com http://www.dynatrace.com
  • 45. @MartinGoodwell References  JMX-Technology homepage  http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html  Monitoring and Managing the Java Platform using JMX technology  https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html  Call-tracing and performance management in microservice environments  http://www.slideshare.net/MartinGoodwell/performance-monitoring-and-call-tracing-in- microservice-environments  Jolokia https://jolokia.org/  Nagios https://www.nagios.org/  statsd https://github.com/etsy/statsd/wiki  Sleepless Dev http://rick-hightower.blogspot.co.uk

Editor's Notes

  1. If we monitor these key metrics in dev and in ops we can make much better decisions on which builds to deploy We immediately detect bad changes and fix them. We will stop builds from making it into Production in case these metrics tell us that something is wrong. We can also take features out that nobody uses if we have usage insights for our services. Like in this case we monitor % of Visitors using a certain feature. If a feature is never used – even when we spent time to improve performance – it is about time to take this feature out. This removes code that nobody needs and therefore reduces technical debt: less code to maintain – less tests to maintain – less bugs in the system!