JAVA Tracing with SnappyFlow


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.

Instrumenting JAVA 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.

Setting up sfTrace to trace the example application

The example application is written in Java and consists of two java programs provision-manager and provision-worker. To start tracing the applications:

  • Install sfAgent, the SnappyFlow agent in the instances where you are running these applications. sfAgent is used to monitor VM performance and dependencies
  • Detailed Installation and configurations instructions are available in
  • To trace provisioning manager and worker do the following:
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.


Get in touch

Or fill the form below, we will get back!


Is SnappyFlow right for you ?

Subscribe to our newsletter