MoSKito at SIlpion Solutionscamp 2014

6ba92bd65b22e6c4b69bae9485124af4?s=47 Leon Rosenberg
September 12, 2014

MoSKito at SIlpion Solutionscamp 2014

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

6ba92bd65b22e6c4b69bae9485124af4?s=128

Leon Rosenberg

September 12, 2014
Tweet

Transcript

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

  2. None
  3. 3 Who am I? Leon Rosenberg - Architect, DevOps. !

    1997 - Started programming with Java. ! 2000 - Started building Portals.! 2003 - Founded anotheria.net.! 2007 - Started MoSKito.
  4. None
  5. None
  6. 6 Today Short Story! Live Demo! Integration! Tools! Success Stories

  7. Because running a production System 
 without monitoring is like

    ... Why MoSKito 7
  8. None
  9. The MoSKito Story

  10. This is you

  11. You developed an APP

  12. And now you've got traffic

  13. Or inherited one

  14. And simply don't know what the app does?

  15. You need Help!

  16. You need MoSKito!

  17. None
  18. Collect data

  19. Organize data

  20. Inspect Intervals

  21. MoSKito Core Team

  22. Discover and analyze

  23. Scale and get in control

  24. Keep history

  25. The big picture !

  26. … and you … ? !

  27. Why MoSKito ?

  28. Lets get some burgers

  29. Integration AOP / CDI / Spring! Proxies! WEB! ! Guide:

    https:// confluence.opensource.anotheria.net/display/ MSK/Integration+Guide 29
  30. 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) { !
  31. 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>
  32. 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) { !
  33. 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>
  34. Proxies 34 public interface SimpleService{ void doSomethingMethod(); } public class

    SimpleServiceImpl implements SimpleService{ public void doSomethingMethod(){ } } SimpleService service = ProxyUtils.createServiceInstance(new SimpleServiceImpl(), "default", SimpleService.class);
  35. 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
  36. Inspect 36 ! <dependency> <groupId>net.anotheria</groupId> <artifactId>moskito-inspect-remote</artifactId> <version>2.5.2</version> </dependency>

  37. What else MoSKito Control ! ! MoSKito Central! ! MoSKito

    @ Barbecue 37
  38. None
  39. 39

  40. 40 MoSKito Control

  41. 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
  42. MoSKito To Go 42

  43. None
  44. None
  45. Success stories Far too many, but here are some :-)

    45
  46. I After 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
  47. I Closer 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
  48. 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
  49. II same call over net repeated thrice time in milliseconds

    49
  50. III A bug only reproduceable by one user.! Second page

    of received messages won’t show. No exception logged. 50
  51. 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
  52. What’s cooking? MoSKito 2.5.3 - JPA! Javaagent ! Central enhancements

    52
  53. 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. 54

  55. 55

  56. 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