Stackify Trace Annotation for Java APM+
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Maven Central Build Status

@Trace Annotation for Stackify Java APM+

Stackify APM+ Overview:

Sign Up for a Trial:


Add it as a maven dependency:



RUM Manual Instrumentation

Real User Monitoring (RUM) manual instrumentation allows you to specify where the RUM JavaScript block is injected.

It is recommended you provide a file in your application classpath with the following content:

stackify.application=My Application Name
stackify.environment=My Environment Name

Your application code will need to call out to the Stackify com.stackify.apm.Stackify.getRUMJavaScriptBlock() method in the <head> section as detailed below:

JSP Example

        <%= com.stackify.apm.Stackify.getRUMJavaScriptBlock() %>
        <script and link tags>

@Trace Annotation

Add custom instrumentation to classes using the @Trace annotation. The annotation needs to be added to the class and the method to be instrumented. This is an alternative to adding a custom configuration file (stackify-apm.json) to your application.

Tracked Functions

  • trackedFunction marks a specific method as a tracked function.
  • trackedFunctionName gives control over how the tracked function will be identified in the dashboard. The function name can be a String and can also include the variables {{ClassName}}, {{MethodName}} and {{MethodParameters[#]}} (where # is an int referencing the parameter index on the annotated method, index starts at 0).

Custom Trace Entry Point

Stackify by default generates traces from web-requests on supported application servers and non-web-requests from supported frameworks. You can extend support by using @Trace(start = true) on a method; which will start a new trace.

import com.stackify.apm.Trace;

public class ClassToBeInstrumented 

    @Trace(start = true)
    public void methodToStartNewTrace()

    public void methodToBeInstrumented()
    public void anotherMethodToBeInstrumented()

    @Trace(trackedFunction = true, trackedFunctionName = "Tracked Function Identifier")
    public void anotherMethodToBeInstrumentedAndMarkedAsTrackedFunction()

    @Trace(trackedFunction = true, trackedFunctionName = "Tracked Function {{ClassName}} - {{MethodParameters[0]}}")
    public void anotherMethodToBeInstrumentedAndMarkedAsTrackedFunctionVariable(String value)

    public void notInstrumented()


Copyright 2017 Stackify, LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.