• Print
  • Share
  • Dark
    Light

Support for Java Background Services

  • Updated on 12 Jun 2018
  • 1 minute to read
  • Contributors

Retrace supports tracking the performance of non-web applications. Web applications have very defined transactions based on when a web request starts and ends. For background services, you must make small modifications to your code to define your transactions.

Retrace can be used with Java based Windows Services and Linux daemon services.

Pre-Requisites

  1. Application must be setup with our custom configuration or be using one our supported Non-WebApp frameworks (Quartz, Spring Batch, Akka). Please follow these steps here first: Configure Custom Profiling for Java.
  2. Application must be setup as a Linux Service.
  3. Linux Agent Installed  

Example using annotations:

import com.stackify.apm.Trace;

@Trace
public class ClassToBeInstrumented
{
    @Trace(start = true)
    public void methodToStartNewTrace()
    {
        //Your code here
    }
}

Update the application startup script to pass in the javaagent option:

-javaagent:/usr/local/stackify/stackify-java-apm/stackify-java-apm.jar
  1. Once traces come in - user will need to go to Other Apps

  1. Click Add from existing

  1. Find their service name and click Add.

Stats should start flowing in at this point. Keep in mind it may take approx. 5 minutes for data to propagate in the Retrace Portal.