Apache Skywalking - Instrumentation of Application Classes

357 views Asked by At

I have recently started exploring skywalking as APM tool.

I am interested in looking at the time spent by methods/functions at application layer. Basically a instrumentation sort of thing for the JAVA application. With Skywalking I just get 3 spans(methods) that have one root function and two DB execute functions. I tried adding the property

'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'

But this dint work. I could still see only 3 spans in the dashboard for the API being hit. Under Profile feature I can get the thread stack. But i am only interested with Hotspot methods. Am i missing something in configuration?

I want classes starting with particular pattern to be instrumented and captured in trace. How can I achieve this? Or is there any other open source APM tool I can start with?

1

There are 1 answers

0
kezhenxu94 On

When using plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX:my.package}, please make sure to move the jdk-threading-plugin under optional-plugins folder into plugins folder because jdk-threading-plugin is disabled by default and you need to move it to plugins to enable it.

In terms of hotspot methods, you have 2 ways:

@Trace
@Tag(key = "tag1", value = "arg[0]")
@Tag(key = "tag2", value = "arg[1]")
@Tag(key = "username", value = "returnedObj.username")
@Tag(key = "age", value = "returnedObj.age")
public User methodYouWantToTrace(String param1, String param2) {
    // ActiveSpan.setOperationName("Customize your own operation name, if this is an entry span, this would be an endpoint name");
    // ...
}