Context capturing allows to define certain parameters and even fields to be captured by the inspectIT agent during monitoring. This data is invalueable for monitoring and analysis as it can provide additional information about the metric. Parameter capturing is also very powerful for invocation sequences to build up a context of the invocation.
...
Often the desired contextual information is not directly provided by the parameter or field, but contained within. So in order to get the contextual information one must navigate the parameter/field by accessing methods. inspectIT comes with the powerful feature of navigating parameters and fields to get to the desired contextual information. One example is the User object is passed in the (made up) employee statistical service used above. Imagine that we want to know the userId which is contained in the User object that the service gets as a parameter. The agent should thus navigate the User parameter and just use the information that is contained within the userId field of the parameter.
Configuration
Context capturing is defined on a sensor basis within the advanced configurations within configuration file.
Capturing Fields
The field capturing configuration consists of two elements separated by colon: f=[Displayname];[fieldname+navigation]
...
The capturing of parameters takes three elements separated by colon. Capturing parameters is (unfortunately) different as the parameter name is not available in the bytecode, so parameters cannot be resolved by their name. Thus one must provide the position of the parameter instead of its name: p=[position_of_parameter];[Displayname];[Navigation]
Here are a few examples:
Configuration | Description |
---|---|
p=0;parameter1; | Takes the first parameter of the method and provide its value as contextual name "parameter1" |
p=0;UserId;id | Takes the first parameter and take the id field's value as contextual name "UserId" |
...