DX Application Performance Management

  • 1.  How to monitor a standalone Java application wich uses Spring?

    Posted Feb 05, 2013 05:16 AM
    Hallo,

    I have a standalone java application i want to monitor and start it like this:
    SET MYPROG_HOME=%~dp0
    
    SET JAVA_OPTS=-Xmx512m -XX:MaxPermSize=256m
    SET CAAPM_OPTS= -Dcom.wily.introscope.agentProfile=d:/wily/core/config/IntroscopeAgent_myProg.profile -javaagent:d:/wily/Agent.jar
    
    CALL java %JAVA_OPTS% %CAAPM_OPTS% -jar %MYPROG_HOME%myprog-1.10.1.0.1.jar %1 
    ENDLOCAL
    EXIT /B %ERRORLEVEL%
    I can see the Programm in the Investigator, but i can't see any of my custom traces.
    Only the basics. CPU, GC Heap, GC Monitor etc. plus NIO, which i activate in the defalt toggles-typical.pbd.

    In the Autoprobe-Log i can find my class and method, and i know that the Programm pass it:
    Processing class de/mycompany/eai/ims/access/facade/EaiAccessFacade
    executeMethod:0 inserted method tracer object allocation: com/wily/introscope/agent/trace/hc2/BlamePointTracer
    In the Documentation i can only find Application-Server configurations.

    Any ideas?

    Regards,
    Johann


  • 2.  RE: How to monitor a standalone Java application?

    Posted Feb 05, 2013 07:51 AM
    Hallo, me again,

    I think i found the Problem.
    I defined the main class an it works.

    I use Spring and get the other Classes from the ApplicationContext:

    ApplicationContext context = context = new ClassPathXmlApplicationContext(new String[] {"spring/applicationContext.xml" });
    IMyClass myclass = context.getBean("myClass", IMyClass .class);

    It seems that AutoProbe have Problems with this.

    Has anyone experience with it?

    Regards,
    Johann


  • 3.  RE: How to monitor a standalone Java application?

    Broadcom Employee
    Posted Feb 05, 2013 11:05 AM
    Can you show us your PBD?

    We have a PBD available for use for Spring Framework in the Community Documents. You may want to start there.

    -Hiko


  • 4.  RE: How to monitor a standalone Java application?

    Posted Feb 06, 2013 05:25 AM
    With the spring.pbd i can see the ClassPathXmlApplicationContext.getBean() method, but not my Class.

    I test it with the new-Operator, and with the new-Operator it works.

    But it will not work if spring creates the Object.

    We have also a web-app with spring, and there is everything ok.

    Regards,
    Johann


  • 5.  RE: How to monitor a standalone Java application?

    Posted Feb 06, 2013 09:29 AM
    OK,
    i have new findings.
    The object, wich i create with the new-Operator only trace his methods until i create the ApplicationContext.

    such as:

    Test test = new Test();
    test.test() <-- appears in the Workstation
    ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring/applicationContext" });
    test.test() <-- appears not

    I don't know exactly how wily works, but ist seems that it have something to do with the Classloader.

    The Question now is, is there any solution?

    Regards,
    Johann


  • 6.  RE: How to monitor a standalone Java application?

    Broadcom Employee
    Posted Feb 06, 2013 10:12 AM
    If you want to instrument your own custom classes and method, you must create your own PBD with tracers and directives which specifically identifies them for monitoring.

    You might want to consider using YATT 0.3.01 or APM Studio to help create your PBD. You can also use transaction trace session to create temporary or permanent PBDs for your agents to use.


  • 7.  RE: How to monitor a standalone Java application?

    Posted Feb 07, 2013 05:04 AM
    I created my own pbd, and i can see my own classes and methods in the Investigator.
    The Problem is, that they disappear when the spring ApplicationContext was created.

    That is what i tried to describe in my last post.


  • 8.  RE: How to monitor a standalone Java application?

    Broadcom Employee
    Posted Feb 07, 2013 10:17 AM
    I think you've got a syntax issue with your PBD.

    You may want to check out my upload of the PBD Syntax Checker. You can find it in the Community Documents. Follow the directions to use the ProbeBuilder.jar that you're using in your agent and validate your PBDs.

    Are you sure that your AutoProbe.log does not show any errors when you try to use your PBD?

    -Hiko


  • 9.  RE: How to monitor a standalone Java application?
    Best Answer

    Posted Feb 08, 2013 07:04 AM
    Ha, i'm so stupid,
    it's so self-evident.
    After the initilization of the ApplicationContext the Program runs to short, so the agent did not have enough time to send the metric.
    I swear, next time i use better test cases!

    Thank you for your patience.

    Regards,
    Johann