Application's start point is the point where transactions begins. The start point shuld be the first point where we can distinguish application's transaction.
Generally, for WAS-based application, the start point is the service method (javax.servlet.HttpServlet.service(HttpServletRequest,HttpServletResponse).However, struts 2 for instance uses doFilter method to process requests.
In this document we will take a look at struts 2 sample application, which requires we set http_service_class option of JENNIFER agent. The sample application we are using is called MyBookStore.
After installation JENNIFER agent, we found that transactions information's are no presented
Since this is a struts 2 application we need to set the application's start point using http_service_method and http_service_class options of JENNIFER agent.
There are two ways to find out and set http_service_class, the first way is to open the application's web.xml file and which filter application is using. However, the application might define serveral filters in web.xml file.
The second way is to capture stack-trace information and follow the application's logic. MyBookStore application is using MySQL database, we set port tracing option of JENNIFER agent like follow (lwst_trace_remote_port=3306).
After extracint the stack-trace, we found that the doFilter method of class ApplicationFilterChain is used to process requests.
We set JENNIFER agent's configuration as follow
After we restart the web application server, JENNIFER detected and showed transaction's information
External Transactions Tracing
tx_client option is used when we need to monitor the relationship between current service and an external transaction.
The sample application used in this example is using port number 1986 to communicate with external service. Therefore we set socket trace option of JENNIFER agent to trace this port
The stack-trace information shows that class TriggerDummyAction is using this port to call external service.
We set tx_client_class, option of JENNIFER agent for the TriggerDummyAction class and then after that we were able to see the external transaction call information.