Services in JVMs

Whenever a transaction that arrives at the JVM has not started in a browser monitored by the Plumbr Browser Agent, service detection is the responsibility of the JVM accepting the HTTP call. Service detection in JVM is done differently for different applications:

  • HTTP calls. If the transactions arrive via an HTTP protocol, Plumbr extracts the service from either of the two:
    • MVC framework metadata. If Plumbr supports a particular Java MVC framework used to process the incoming HTTP request, service detection uses the class/method name of the controller invoked by the transaction
    • For the transactions not processed by a supported MVC framework, the service is detected using the information encoded in the URL
  • EJB methods. If the transaction arriving to the JVM is a remote EJB call, Plumbr users the EJB class and method name as the service
  • Swing event listeners. If the transaction was captured in a Swing application, this transaction uses a Swing event and action listeners as the service

Detecting a service from MVC

When the JVM monitored by Plumbr exposes the services via an MVC framework supported by Plumbr, the service name is extracted from the controller processing the transaction. For example, when an HTTP request such as

http://www.example.com/payments?actionId=payInvoice&invoiceId=411121

is mapped and processed by a Struts controller, the service is extracted from the controller. An example of such a controller would then be visible in the Plumbr interface similar to:

com.example.payments.PaymentAction.execute().

The controllers from the following MVC frameworks are currently supported for service detection:

  • Spring MVC
  • Struts 1 & 2
  • GWT 2.x
  • JSF 1.1+
  • Vaadin 6+
  • ZK 7+

Detecting a service from an URL

Whenever the HTTP request is not processed by an MVC framework known to Plumbr, service detection falls back to capturing the service from the information encoded in the URL.

Let us explain this approach using a transaction arriving at the following URL as an example:

http://www.example.com/shop/cart/add/iPhone6

Service detection parses the URL to use /shop/cart/add/iPhone6 as the input. As seen, the last token identifying the product added to the shopping cart (iPhone6) is actually a parameter of the service. In order to group all interactions adding items to the shopping cart under the same service, Plumbr replaces the iPhone6 token in the URL with the placeholder {1}. As a result, the service detected from the transaction is

/shop/cart/add/{1}.

Using this approach makes it possible to group transactions accessing the same /shop/cart/add service together, regardless of the product you added to the shopping cart.