dev@glassfish.java.net

Re: Update on Monitoring in V3

From: Prashanth Abbagani <Prashanth.Abbagani_at_Sun.COM>
Date: Thu, 16 Jul 2009 13:37:06 -0700

Vivek Pandey wrote:
> Jennifer Chou wrote:
>> A new module like jruby which is not in the existing
>> module-monitoring-levels (see asadmin get
>> server.monitoring-service.*), is enabled for monitoring by default,
>> and is always enabled. This is until the new config pluggability
>> comes in and we can add new config elements.
>>
> ok.
>> Did you try starting with the btrace agent (see below)? Did you see
>> any exceptions?
>> $>java
>> -javaagent:/space/GFV3_BLD/glassfishv3/glassfish/lib/monitor/btrace-agent.jar=dumpClasses=true,unsafe=true
>> -jar glassfishv3/glassfish/modules/glassfish.jar/
>>
>
> I don't see any exception and yes, I tried the above command. Do you
> have any other stats provider whose ProbeListener gets invoked? If
> they do get invoked, I would like to see those code to compare against
> mine.
>
> -vivek.
To see how this works, try the following steps.

1) start the server with javaagent

    /$>java
    -javaagent:/Users/abbagani/v3_working/v3/glassfishv3/glasish/lib/monitor/btrace-agent.jar=unsafe=true
    -jar glassfish.jar/

2) Turn the monitoring to high for web-container

    $>.//asadmin set
    configs.config.server-config.monitoring-service.module-monitoring-levels.web-container=HIGH/


2) deploy a simple hello app (attached).

4) Access the URL (http://localhost:8080/hello)

5) Do /./asadmin get --monitor=true "*" | grep requestcount/ You should
see the following.

/server.web.request.requestcount-count = 2/


-Prashanth
>
>
>> I tried actually, but also couldn't see stats getting updated but it
>> could just be my env, as I have bunch of changes locally. I see the
>> following exception when I deploy a web app. Not sure if this why
>> it's not working.
>> INFO: Error while invoking client: false ==>
>> java.lang.reflect.InvocationTargetException
>> Jul 16, 2009 5:14:20 PM
>>
>> Vivek Pandey wrote:
>>> I can see all my jruby probes and stats provider but my listener
>>> stats are not updated, they are all to their initial values. Are the
>>> @ProbeListner invoked? Maybe I need to enable monitoring for JRuby
>>> stats provider. How do I enable JRuby container monitoring?
>>>
>>> -vivek.
>>>
>>> Prashanth Abbagani wrote:
>>>> Hello,
>>>>
>>>> The monitoring in V3 is now integrated and working with several
>>>> stats from various module showing up. See the instructions towards
>>>> the end to which explain on how to view these stats.
>>>>
>>>> Following are the features of monitoring that were accomplished
>>>> before the soft-code freeze deadline.
>>>>
>>>> 1. Monitoring Probe Providers bundled by the module owners are
>>>> discovered automatically and processed so probes are being fired
>>>> when it visits module's code path
>>>> 2. Following is done with the monitoring StatsProviders which
>>>> listens to the probes and updates the statistics
>>>> 1. We process the statsProviders (annotations) for the stats
>>>> you have annotated to be exposed
>>>> 2. Exposing the stats through CLI (asadmin)
>>>> 3. Exposing the stats with REST
>>>> 4. GUI team is working on exposing these stats for some of
>>>> the critical modules
>>>> 5. Integrate with Gmbal to expose these stats as JMX/AMX
>>>> MBeans
>>>> 6. We also are ensuring backward compatibility for all the V2
>>>> level stats
>>>> 7. Handling of config changes (from CLI,GUI or REST), so the
>>>> stats get enabled/disabled automatically
>>>> 3. We are using BTrace as our underlying infrastructure to do the
>>>> byte-code instrumentation of the provider classes so the probes
>>>> are fired and the registered listeners (StatsProviders) are
>>>> called.
>>>>
>>>> _Steps to see the monitoring in action
>>>> _
>>>> You will need the BTrace agent running. You will need to start the
>>>> server with the following agent option (See Issue 8706
>>>> <https://glassfish.dev.java.net/issues/show_bug.cgi?id=8706>, you
>>>> shouldn't need this step once its fixed.)
>>>> /
>>>> $>java
>>>> -javaagent:/space/GFV3_BLD/glassfishv3/glassfish/lib/monitor/btrace-agent.jar=dumpClasses=true,unsafe=true
>>>> -jar glassfishv3/glassfish/modules/glassfish.jar/
>>>>
>>>> To see the monitoring stats, you will have to turn on monitoring
>>>> for the interested modules (see the attached script to turn them
>>>> all to ON)
>>>>
>>>> There are various ways to see your stats,
>>>>
>>>> 1. REST - http://localhost:4848/monitoring/domain
>>>> 2. asadmin - ./asadmin get --monitor=true "*"
>>>> 3. JMX/AMX - Use JConsole to connect to 'localhost:8686'
>>>>
>>>>
>>>> Let us know if you run into any issues or if you have any questions.
>>>>
>>>> thanks
>>>> Prashanth
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>