In this blog series, we consider a sample JAVA application that consists of two programs, a provision-manager and a provision-worker. We will use SnappyFlow's sfTrace agent to analyze the performance of this sample application. sfTrace can auto-instrument JAVA, python and nodeJS applications.
sfTrace JAVA agent uses an open source code generation and instrumentation library ByteBuddy. ByteBuddy leverages the instrumentation APIs provided by JAVA byte code. It modifies the Java classes during the runtime of an application. Application is not re-compiled for instrumentation. This modified code generates information about the code paths like processing http request, queries databases etc. The sfTrace Java agent can instrument a wide range of technologies like web frameworks, application servers/servlets, data stores, networking frameworks, asynchronous frameworks, scheduling frameworks, messaging frameworks, logging frameworks etc. It is also possible to create custom instrumentation through the agent APIs.
The example application is written in Java and consists of two java programs provision-manager and provision-worker. To start tracing the applications:
java -javaagent:/opt/sfagent/sftrace/java/sftrace-java-agent.jar - Dsftrace.service_name=provision-manager -jar provision-manager.jar
java -javaagent:/opt/sfagent/sftrace/java/sftrace-java-agent.jar - Dsftrace.service_name=provision-worker -jar provision-worker.jar
Provision-manager and provision-worker processes are run under the sfTrace java agent. sfTrace Java agent automatically instruments the application and the libraries to intercept the execution steps to extract information and create trace data.