@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface Trace
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.
import com.stackify.apm.Trace;
@Trace
public class ClassToBeInstrumented
{
@Trace(start = true)
public void methodToStartNewTrace()
{
...
}
@Trace
public void methodToBeInstrumented()
{
...
}
@Trace
public void anotherMethodToBeInstrumented()
{
...
}
@Trace(trackedFunction = true, trackedFunctionName = "Function Identifier")
public void anotherMethodToBeInstrumentedAndMarkedAsTrackedFunction()
{
...
}
@Trace(trackedFunction = true, trackedFunctionName = "Tracked Function {{ClassName}} - {{MethodParameters[0]}}")
public void anotherMethodToBeInstrumentedAndMarkedAsTrackedFunctionVariable(String value)
{
...
}
@Trace(category = "MyService", subcategory = "MyMethod")
public void anotherMethodToBeInstrumentedAsMyServiceMyMethod(String value)
{
...
}
@Trace(action = true)
public void anotherMethodToBeInstrumentedAsRequestedAction(String value)
{
...
}
public void notInstrumented()
{
...
}
}
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
action |
java.lang.String |
category |
boolean |
start |
java.lang.String |
subcategory |
boolean |
trackedFunction |
java.lang.String |
trackedFunctionName |
Copyright © 2018 Stackify, LLC. All Rights Reserved.