Monitor WSO2 products using AppDynamics

Rajkumar Rajaratnam
3 min readJan 22, 2018

--

The AppDynamics enables you to monitor and manage your entire application-delivery ecosystem, from the mobile app or browser client request through your network, backend databases and application servers and more.

It gives you a single view across your application landscape, letting you quickly navigate from the global view of your distributed application right down to the call graphs or exception reports generated on individual hosts.

This article describes how to configure AppDyanamics to monitor an API Management platform implemented using WSO2 middleware stack (ESB, APIM and DSS).

AppDynamics Essentials

AppDynamics consists of two main components: Controller and Agent. Agent collects metrics from applications and publish it to Controller. Controller collects metrics from many agents, aggregates, analyzes and presents diagnostics information in a very user-friendly dashboard.

Setting up AppDynamics Controller

Controller can either be a SaaS controller or on-premise controller. I’ll be using a SaaS controller in this article to monitor an API management platform implemented using WSO2 middleware stack (ESB v5.0.0, APIM 1.10 and DSS 3.2.0).

The following video explains how we can get an AppDynamics SaaS controller.

Setting up AppDynamics Agent

I’ll be using Java agent (v4.3.7.1) in this article to monitor WSO2 servers.

The following video explains how we can configure AppDynamics agent to monitor WSO2 servers.

Configure Transaction Discovery and Correlation

AppDynamics doesn’t discover transactions flowing through WSO2 ESB and API Manager by default. Reason is ESB and APIM are using a custom transport, AppDynamics doesn’t know the entry and exit points of this custom transport. So, we will have to configure custom POJO entry point and a logical endpoint to instruct AppDynamics to monitor transactions flowing through ESB and APIM. Custom POJO entry point is “org.apache.synapse.core.axis2.SynapseMessageReceive#receive()”.

We don’t have do this for DSS and Key Manager since they expose web services using servlet transport and AppDynamics is capable of discovering servlet entry/exit points by default.

The following video explains how to configure transaction discovery and correlation.

Configure Transaction Splitting

We might want to track transactions in API level, or even in API resource level. AppDynamics provides a way to do this using something called transaction splitting. We can split the transactions using request URL (or part of request URL). In our custom POJO entry point, we can access the request URL using the getter chain “getOptions().getTo().getAddress()” on the 0th parameter of receive() method.

The following video explains how we can configure transaction splitting.

Configure Call Graph

AppDynamics uses a dynamic baseline approach and identifies intermittent performance issues (by comparing current transaction’s metrics against previous transactions’ metrics). If it identifies a performance issue, it will take a snapshot of that transaction. Snapshot contains more diagnostic information such as call-graph within each layer, request payload, headers, etc.

The following video explains transaction snapshots and call-graphs.

Configure Asynchronous Transaction

AppDynamics doesn’t calculate the end-to-end latency of transactions flowing through WSO2 stack by default. The reason is that ESB and APIM (GW) are using asynchronous non-blocking HTTP outbound calls. For example, if ESB or GW is calling a backend, they don’t wait for the response. Instead, they register a callback and return immediately.

In our application stack, once GW sends out the request to ESB, AppDynamics assumes the transaction is complete. Hence, the latency AppDynamics captures by default is just the latency introduced in the request path of GW.

AppDynamics provides a way to configure a logical termination point for a transaction to calculate the end-to-end latency. The logical transaction termination point in WSO2 is “org.apache.synapse.core.axis2.Axis2Sender#sendBack()”.The following video explains how we can do that.

--

--

Rajkumar Rajaratnam

Drawing from a decade of hands-on experience developing large-scale Middleware applications – a journey through challenges, solutions, and valuable lessons.