MoSKito at Silpion Solutionscamp 2014

56
Leon Rosenberg (@dvayanu) anotheria solution GmbH 1 Open Source APM

description

MoSKito als leistungsfähige Open-Source Alternative zu Applikation Management Systemen wie NewRelic oder AppDynamic - Slides - http://www.solutionscamp.de/session-detail/?3-moskito-als-leistungsfaehige-open-source-alternative-zu-applikation-management-systemen-wie-newrelic-oder-appdynamic

Transcript of MoSKito at Silpion Solutionscamp 2014

Page 1: MoSKito at Silpion Solutionscamp 2014

Leon Rosenberg (@dvayanu)!anotheria solution GmbH

1

Open Source APM

Page 2: MoSKito at Silpion Solutionscamp 2014
Page 3: MoSKito at Silpion Solutionscamp 2014

3

Who am I?

Leon Rosenberg - Architect, DevOps. !

1997 - Started programming with Java. !

2000 - Started building Portals.!

2003 - Founded anotheria.net.!

2007 - Started MoSKito.

Page 4: MoSKito at Silpion Solutionscamp 2014
Page 5: MoSKito at Silpion Solutionscamp 2014
Page 6: MoSKito at Silpion Solutionscamp 2014

6

Today

Short Story!

Live Demo!

Integration!

Tools!

Success Stories

Page 7: MoSKito at Silpion Solutionscamp 2014

Because running a production System without monitoring is like ...

Why MoSKito

7

Page 8: MoSKito at Silpion Solutionscamp 2014
Page 9: MoSKito at Silpion Solutionscamp 2014

The MoSKito Story

Page 10: MoSKito at Silpion Solutionscamp 2014

This is you

Page 11: MoSKito at Silpion Solutionscamp 2014

You developed an APP

Page 12: MoSKito at Silpion Solutionscamp 2014

And now you've got traffic

Page 13: MoSKito at Silpion Solutionscamp 2014

Or inherited one

Page 14: MoSKito at Silpion Solutionscamp 2014

And simply don't know what the app does?

Page 15: MoSKito at Silpion Solutionscamp 2014

You need Help!

Page 16: MoSKito at Silpion Solutionscamp 2014

You need MoSKito!

Page 17: MoSKito at Silpion Solutionscamp 2014
Page 18: MoSKito at Silpion Solutionscamp 2014

Collect data

Page 19: MoSKito at Silpion Solutionscamp 2014

Organize data

Page 20: MoSKito at Silpion Solutionscamp 2014

Inspect Intervals

Page 21: MoSKito at Silpion Solutionscamp 2014

MoSKito Core Team

Page 22: MoSKito at Silpion Solutionscamp 2014

Discover and analyze

Page 23: MoSKito at Silpion Solutionscamp 2014

Scale and get in control

Page 24: MoSKito at Silpion Solutionscamp 2014

Keep history

Page 25: MoSKito at Silpion Solutionscamp 2014

The big picture !

Page 26: MoSKito at Silpion Solutionscamp 2014

… and you … ? !

Page 27: MoSKito at Silpion Solutionscamp 2014

Why MoSKito ?

Page 28: MoSKito at Silpion Solutionscamp 2014

Lets get some burgers

Page 29: MoSKito at Silpion Solutionscamp 2014

Integration

AOP / CDI / Spring!

Proxies!

WEB!

!

Guide: https://confluence.opensource.anotheria.net/display/MSK/Integration+Guide

29

Page 30: MoSKito at Silpion Solutionscamp 2014

AOP

30

@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 31: MoSKito at Silpion Solutionscamp 2014

AOP + MAVEN

31

<dependencies> <dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-core</artifactId> <version>2.5.2</version> </dependency> <dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-aop</artifactId> <version>2.5.2</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.6</source> <target>1.6</target> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build>

Page 32: MoSKito at Silpion Solutionscamp 2014

CDI

32

@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 33: MoSKito at Silpion Solutionscamp 2014

CDI

33

<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/javaee!http://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 34: MoSKito at Silpion Solutionscamp 2014

Proxies

34

public interface SimpleService{ void doSomethingMethod(); }

public class SimpleServiceImpl implements SimpleService{ public void doSomethingMethod(){ } }

SimpleService service = ProxyUtils.createServiceInstance(new SimpleServiceImpl(), "default", SimpleService.class);

Page 35: MoSKito at Silpion Solutionscamp 2014

WEB

35

<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 36: MoSKito at Silpion Solutionscamp 2014

Inspect

36

! <dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-inspect-remote</artifactId> <version>2.5.2</version> </dependency>

Page 37: MoSKito at Silpion Solutionscamp 2014

What else

MoSKito Control !

!

MoSKito Central!

!

MoSKito @ Barbecue

37

Page 38: MoSKito at Silpion Solutionscamp 2014
Page 39: MoSKito at Silpion Solutionscamp 2014

39

Page 40: MoSKito at Silpion Solutionscamp 2014

40

MoSKito Control

Page 41: MoSKito at Silpion Solutionscamp 2014

MoSKito Central

Central server for snapshot storage.!

Attachable storages can store data into sql- or nosql- based databases, xml/json files etc.!

Runs in remote or embedded mode.

41

Page 42: MoSKito at Silpion Solutionscamp 2014

MoSKito To Go

42

Page 43: MoSKito at Silpion Solutionscamp 2014
Page 44: MoSKito at Silpion Solutionscamp 2014
Page 45: MoSKito at Silpion Solutionscamp 2014

Success stories

Far too many, but here are some :-)

45

Page 46: MoSKito at Silpion Solutionscamp 2014

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. With MoSKito inspection we were able to detect which client was producing most traffic.

46

Page 47: MoSKito at Silpion Solutionscamp 2014

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

47

Page 48: MoSKito at Silpion Solutionscamp 2014

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.

48

Page 49: MoSKito at Silpion Solutionscamp 2014

IIsame call over net repeated thrice

time in milliseconds

49

Page 50: MoSKito at Silpion Solutionscamp 2014

IIIA bug only reproduceable by one user.!

Second page of received messages won’t show. No exception logged.

50

Page 51: MoSKito at Silpion Solutionscamp 2014

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.

51

Page 52: MoSKito at Silpion Solutionscamp 2014

What’s cooking?

MoSKito 2.5.3 - JPA!

Javaagent !

Central enhancements

52

Page 53: MoSKito at Silpion Solutionscamp 2014

End of Data.

Thank you.!

53

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-examples

https://itunes.apple.com/de/app/msk-control/id688838411?l=en&mt=8

Page 54: MoSKito at Silpion Solutionscamp 2014

54

Page 55: MoSKito at Silpion Solutionscamp 2014

55

Page 56: MoSKito at Silpion Solutionscamp 2014

End of Data.

Thank you.!

56

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-examples

https://itunes.apple.com/de/app/msk-control/id688838411?l=en&mt=8