Hi Anjana,
Regarding the field names of streams, we can obtain the field names from
the 'key' attribute of the <parameterName> in configuration file. That
value will be used during the alteration of the schema (to add indexing for
arbitrary fields) and publishing the arbitrary map from the agent. Payload
data of events at each scenario will be as follows, (additionally timestamp
will also be passed,)
- *InsertBefore* (These are entered soon after the method signature, and
above the 1st line of the method) =>
[Scenario_name, Class_name, Method_name]
- *InsertAt *(From any point within the method, there can be more than
one event published during the method execution, because user can define
InsertAt for different lines) =>
[Scenario_name, Class_name, Method_name] ,
[ArbitraryMap <column_name,parameter_value>]
- *InsertAfter* (Inserted after the last line of the method, before the
'}' of method) =>
[Scenario_name, Class_name, Method_name,
execution_deuration]
We will be adding a code segment which create a Map and put values to the
map at each instrumenting method, if the user specifies any <parameterName>
in the configuration file.
Regarding the monitoring of different scenarios, can't we add all the
scenarios into same configuration file. According to current state, we can
add multiple scenarios into the same configuration file with multiple
classes and methods listed under them.
Thanks,
Udani
On Tue, Nov 3, 2015 at 11:41 PM, Inosh Goonewardena <[email protected]> wrote:
> Hi Udani,
>
> At the end, we should be able to use this agent with any product (not only
> DAS). So basically, the idea should be to install this agent in any product
> to capture internal activities and publish to DAS as events.
>
> Arbitrary fields approach is the right choice here, because fields will
> vary for each instrumenting method. To enable indexing for these arbitrary
> field you can use Analytics REST API provided by DAS [1]. However since it
> is secured with basic authentication you have think about a proper way of
> providing required credentials.
>
> In addition, for data publisher also, it require credentials, DAS receiver
> URL, agent configuration information. Please explain the approach on
> configuring these information as well.
>
> [1] https://docs.wso2.com/display/DAS300/Analytics+REST+API+Guide
>
>
> On Tue, Nov 3, 2015 at 8:55 PM, Anjana Fernando <[email protected]> wrote:
>
>> 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
>>
>>
>
>
> --
> Thanks & Regards,
>
> Inosh Goonewardena
> Associate Technical Lead- WSO2 Inc.
> Mobile: +94779966317
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>
--
*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