Hi Udani,

Can you please explain a bit more on, how the field names of the streams
will be derived. That is, for example, how will an event look like, when a
method before scenario gets hit, method after, insert at and so on.
Basically, give some sample event payloads for each scenario.

Also, ideally later on, we should be able to copy new configuration files
for new scenarios to a specific folder of the agent, and the agent should
pick up all the configuration files, load up all the scenario in the agent
startup and execute them. So we can create these configuration files for
specific scenarios and install them when needed. For example, database
monitoring scenario, JMS event monitoring scenario configuration files
etc..

Cheers,
Anjana.

On Wed, Oct 28, 2015 at 1:28 AM, Udani Weeraratne <[email protected]> wrote:

> Hi,
>
> I am working on a java agent which can be used to monitor different
> activities carried out within DAS. Main concept of java agent is to modify
> bytecode of classes before they load onto JVM (bytecode instrumentation).
> This provide the ability to inject code into classes according to our
> requirement.
>
> Currently we are trying to implement a simple agent, which can monitor
> method calls and parameters passed under a given scenario and publish them
> to a stream in DAS. The architecture of this approach will be as follows.
>
> [image: Inline image 1]
>
>
> We will provide a simple configuration file, where user has to specify the
> class name, method name with signature, parameters to monitor and the
> location to be inserted (using javassist we can insert code at the top, at
> bottom and at a specific line of the method). Then the agent will be
> initialized based on the user requirement and instrument the requested
> methods before respective classes load onto JVM. (Javassist will be the
> library used in the instrumentation process) Once the classes are
> instrumented before the server start running, we will be able to publish
> events containing the intercepted data to a stream in DAS. Using the
> ability to publishing arbitrary fields in DAS, we are trying to provide the
> ability to index and store events with intercepted data. This can be used
> as a profiler to monitor the activities of the server.
>
> Layout of configuration file
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>
> <instrumentationAgent>
>
>     <scenario name="jdbc-monitoring">
>
>         <instrumentingClass name="com.mysql.jdbc.ConnectionImpl">
>
>                <instrumentingMethod name="prepareStatement"
>
>
> signature="(Ljava/lang/String;)Ljava/sql/PreparedStatement;">
>
>                <insertBeforeContent></insertBeforeContent>
>
>                <insertAts>
>
>                    <insertAt lineNo="1">
>
>                            <parameterName key="query">$1</parameterName>
>
>                    </insertAt>
>
>                </insertAts>
>
>                <insertAfterContent></insertAfterContent>
>
>            </instrumentingMethod>
>
>        </instrumentingClass>
>
>        </scenario>
>
> </instrumentationAgent>
>
> This is the overall idea about the java agent we are working on. Hope this
> will be able to add value to the product. Appreciate any suggestions on
> this.
>
>
> Thanks,
>
> Udani
>
> --
> *Udani Weeraratne*
> Software Engineer - Intern
> WSO2 Inc.: www.wso2.com
> lean.enterprise.middleware
>
> Email: [email protected]
> Mobile: +94 775437714
> LinkedIn: *https://lk.linkedin.com/in/udaniweeraratne
> <https://lk.linkedin.com/in/udaniweeraratne>*
> Blog : https://udaniweeraratne.wordpress.com/
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
*Anjana Fernando*
Senior Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to