MoSKito at Silpion Solutionscamp 2014

Post on 05-Dec-2014

189 views 0 download

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

Leon Rosenberg (@dvayanu)!anotheria solution GmbH

1

Open Source APM

3

Who am I?

Leon Rosenberg - Architect, DevOps. !

1997 - Started programming with Java. !

2000 - Started building Portals.!

2003 - Founded anotheria.net.!

2007 - Started MoSKito.

6

Today

Short Story!

Live Demo!

Integration!

Tools!

Success Stories

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

Why MoSKito

7

The MoSKito Story

This is you

You developed an APP

And now you've got traffic

Or inherited one

And simply don't know what the app does?

You need Help!

You need MoSKito!

Collect data

Organize data

Inspect Intervals

MoSKito Core Team

Discover and analyze

Scale and get in control

Keep history

The big picture !

… and you … ? !

Why MoSKito ?

Lets get some burgers

Integration

AOP / CDI / Spring!

Proxies!

WEB!

!

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

29

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) { !

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>

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) { !

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>

Proxies

34

public interface SimpleService{ void doSomethingMethod(); }

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

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

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

Inspect

36

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

What else

MoSKito Control !

!

MoSKito Central!

!

MoSKito @ Barbecue

37

39

40

MoSKito Control

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

MoSKito To Go

42

Success stories

Far too many, but here are some :-)

45

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

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

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

IIsame call over net repeated thrice

time in milliseconds

49

IIIA bug only reproduceable by one user.!

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

50

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

What’s cooking?

MoSKito 2.5.3 - JPA!

Javaagent !

Central enhancements

52

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

54

55

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