leon rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfaop + maven 18 net.anotheria...
TRANSCRIPT
![Page 1: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/1.jpg)
�1
Monitoring tomcat web application in production
Leon Rosenberg (@dvayanu)
![Page 2: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/2.jpg)
![Page 3: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/3.jpg)
�3
Todays Contents
Basic Concepts of MoSKito
Burgershop Demo
Recap
Integration (if time allows)
Q & A
![Page 4: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/4.jpg)
Because running a production System without monitoring is like ...
�4
Why MoSKito?
![Page 5: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/5.jpg)
MoSKito Core Team
![Page 6: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/6.jpg)
Collect data
![Page 7: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/7.jpg)
Organise data
![Page 8: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/8.jpg)
Inspect Intervals
![Page 9: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/9.jpg)
Discover and analyse
![Page 10: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/10.jpg)
Scale and get in control
![Page 11: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/11.jpg)
DEMO TIMEhttp://burgershop-hamburg.demo.moskito.org/burgershop/
http://burgershop-hamburg.demo.moskito.org/burgershop/moskito-inspect/mskDashboard?dashboard=Burger+Board
![Page 12: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/12.jpg)
Performance data collection
Application Insights with MoSKito Inspect
Code and Dataflow Tracing with Journeys
Error Management
System overview with MoSKito Control
�12
Why MoSKito ?
![Page 13: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/13.jpg)
Why MoSKito ?
![Page 14: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/14.jpg)
The big picture
![Page 15: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/15.jpg)
�15
http://www.moskito.org
https://github.com/anotheria/moskito
https://github.com/anotheria/moskito-control
http://search.maven.org/#search%7Cga%7C1%7Cmoskito
https://itunes.apple.com/de/app/moskito-ui/id531387262?l=en&mt=8
https://github.com/anotheria/moskito-demo
https://itunes.apple.com/de/app/msk-control/id688838411?l=en&mt=8
Q & A Time?
![Page 16: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/16.jpg)
Integration
AOP / CDI / Spring
Proxies
WEB
Java Agent
Guide: https://confluence.opensource.anotheria.net/display/MSK/Integration+Guide
�16
![Page 17: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/17.jpg)
AOP
�17
@Monitor public class YourClass {
public class YourClass { @Monitor public void firstMonitoredMethod(){... @Monitor public void secondMonitoredMethod(){... public void notMonitoredMethod(){...
@Monitor public class YourClass { public void thisMethodWillBeMonitored(){... @DontMonitor public void thisMethodWillBeExcludedFromMonitoring(){
@Count public class PaymentCounter {
@Count public class PaymentCounter { /** * Electronic card payment (lastchrifteinzug in germany). */ public void ec(){} /** * Credit card payment. */ public void cc(){} /** * Payment via paypal. */ public void paypal(){} }
@CountByParameter void ingredientUsed(String ingredient) {
![Page 18: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/18.jpg)
AOP + MAVEN
�18
<dependencies> <dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-core</artifactId> <version>2.8.7</version> </dependency> <dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-aop</artifactId> <version>2.8.7</version> </dependency>
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.4</version> <configuration> <aspectLibraries> <aspectLibrary> <groupId>net.anotheria</groupId> <artifactId>moskito-aop</artifactId> </aspectLibrary> </aspectLibraries> <source>1.7</source> <target>1.7</target> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
![Page 19: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/19.jpg)
CDI
�19
@Monitor @ProducerRuntime(producerId=”Foo”, category=”my”) public class YourClass {
public class YourClass { @Monitor public void firstMonitoredMethod(){... @Monitor(“dao”) public void secondMonitoredMethod(){... public void notMonitoredMethod(){...
@Monitor(MonitoringCategorySelector.WEB) public class YourClass { public void thisMethodWillBeMonitored(){... @DontMonitor public void thisMethodWillBeExcludedFromMonitoring(){
@Count public class PaymentCounter {
@Count public class PaymentCounter { /** * Electronic card payment (lastchrifteinzug in germany). */ public void ec(){} /** * Credit card payment. */ public void cc(){} /** * Payment via paypal. */ public void paypal(){} }
@CountByParameter void ingredientUsed(String ingredient) {
![Page 20: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/20.jpg)
CDI
�20
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> <interceptors> <class>net.anotheria.moskito.integration.cdi.CountInterceptor</class> <class>net.anotheria.moskito.integration.cdi.CallInterceptor</class>
<class>net.anotheria.moskito.integration.cdi.WebCallInterceptor<class> <class>net.anotheria.moskito.integration.cdi.ServiceCallInterceptor</class> <class>net.anotheria.moskito.integration.cdi.DaoCallInterceptor</class>
</interceptors></beans>
![Page 21: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/21.jpg)
Proxies
�21
public interface SimpleService{ void doSomethingMethod(); }
public class SimpleServiceImpl implements SimpleService{ public void doSomethingMethod(){ } }
SimpleService service = ProxyUtils.createServiceInstance(new SimpleServiceImpl(), "default", SimpleService.class);
![Page 22: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/22.jpg)
WEB
�22
<filter> <filter-name>RequestURIFilter</filter-name> <filter-class>net.anotheria.moskito.web.filters.RequestURIFilter</filter-class> <init-param> <param-name>limit</param-name> <param-value>1000</param-value> </init-param> </filter> <filter-mapping> <filter-name>RequestURIFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
<filter> <filter-name>DomainFilter</filter-name> <filter-class>net.anotheria.moskito.web.filters.DomainFilter</filter-class> <init-param> <param-name>limit</param-name> <param-value>50</param-value> </init-param> </filter> <filter-mapping> <filter-name>DomainFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Automagically with servlet 3.0
![Page 23: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/23.jpg)
Inspect
�23
<dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-inspect-remote</artifactId> <version>2.8.7</version> </dependency>
![Page 24: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/24.jpg)
Success stories
Far too many, but here are some :-)
�24
![Page 25: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/25.jpg)
IAfter a release of a new version huge traffic increase on one of the databases was detected.
The database in question was used by a service. There were 20 clients (code components) using this service.
MoSKito showed that 55% of the traffic to the service came from one client. MoSKito Inspect showed which client was producing most traffic.
�25
![Page 26: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/26.jpg)
ICloser inspection (code review) of the client revealed a bug which led to double calls to the service.
Incident solved in 30 minutes.
Most traffic
Created here
�26
![Page 27: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/27.jpg)
II
Application overall performance was insufficient.
With moskito journeys and call tree analysis we were able to find redundant calls to the backend and remove them.
Request duration reduced to 50% with 4 hours analysis and 4 hours coding effort.
�27
![Page 28: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/28.jpg)
IIsame call over net repeated thrice
time in milliseconds
�28
![Page 29: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/29.jpg)
IIIA bug only reproduceable by one user.
Second page of received messages won’t show. No exception logged.
�29
![Page 30: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/30.jpg)
Broken Call
red color indicates that the method was terminated
abnormaly (exception)
possible reason - user didn’t exist in the db and the code didn’t know how to handle it.
�30
![Page 31: Leon Rosenberg (@dvayanu)apachecon.com/euroadshow18/moskito-tomcat.pdfAOP + MAVEN 18 net.anotheria moskito-core](https://reader034.vdocuments.mx/reader034/viewer/2022042415/5f302347bdbfe00f40656015/html5/thumbnails/31.jpg)
Thank you.
�31
http://www.moskito.org
https://github.com/anotheria/moskito
https://github.com/anotheria/moskito-control
http://search.maven.org/#search%7Cga%7C1%7Cmoskito
https://itunes.apple.com/de/app/moskito-ui/id531387262?l=en&mt=8
https://github.com/anotheria/moskito-demo
https://itunes.apple.com/de/app/msk-control/id688838411?l=en&mt=8
End of Data