How to use introscope.agent.transactiontracer.userid.key?

Document ID : KB000013772
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

How to use introscope.agent.transactiontracer.userid.key?

Answer:

1. Say for example your application's web URL access is:

http://<host>/app/LoginPage.jsp?user=jane.doe


2. This JSP forwards the request and response objects to a servlet:

...
<% com.wily.tools.userid.LoginApp.doLogin(request,response); %>
...


3. The sevlet processes this information as follows:

...
public static void doLogin(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
String user = request.getParameter("user");
try
{
HttpSession session = request.getSession(true);
session.setAttribute("userid", user);
..

4. As you can see above the servlet defines a "userid" as a session attribute, you can configure the IntroscopeAgent.profile to trace information based on the userid as below:

...

introscope.agent.transactiontracer.userid.method=HttpSession.getValue
introscope.agent.transactiontracer.userid.key=userid


5. Your application needs a similar implementation for this feature to work properly.