share library_books

Transaction Naming

To name web transactions (i.e., transactions triggered by an HTTP request) the SPM Java tracing agent uses method signature of entry point as the transaction name. Entry point methods can be last filter/servlet executed in a chain, or a Spring handler method name (i.e., a method name with the `@RequestHandler` annotation). Alternatively, transaction names can be redefined using servlet config. For example, here we name them "WorkerTransaction":

<servlet>
  <servlet-name>WorkerServlet</servlet-name>
  <servlet-class>phi.WorkerServlet</servlet-class>
  <init-param>
    <param-name>com.sematext.spm.tracing.agent.TRANSACTION_NAME</param-name>
    <param-value>WorkerTransaction</param-value>
  </init-param>
</servlet>

Precedence rules for resolving transaction names:

Precedence Naming
3 Servlet config parameter
2 Spring handler
1 Servlet/Filter

Non-web transactions can be (re)named using the transaction-name attribute as described in Custom Pointcuts.