com.stackify.apm
@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 |
String |
category |
boolean |
start |
String |
subcategory |
boolean |
trackedFunction |
String |
trackedFunctionName |
public abstract boolean trackedFunction
public abstract String trackedFunctionName
public abstract String category
public abstract String subcategory
public abstract boolean action
public abstract boolean start
Copyright © 2017 Stackify, LLC. All Rights Reserved.