I am using the current Java APM Agent to instrument a desktop java app (not a web server). I can see transactions for some runnable classes I recognize, but I am also seem a few like
2#run. Not sure what those are exactly?
Perhaps they are just anonymous classes? Or maybe just instance of Runnable itself?
Hi @Scott_Chapman ,
In order to know where does those methods come from, you can enable debug logging with
log_level=debug, then restart your application. The lines that contain
method match should give you a hint on the class where this method is defined, here it's very likely to be anonymous inner classes due to the numeric pattern.
If you want more deterministic naming for transactions, you can use the Annotation API to make that more explicit.
Ah cool, I think I get it. Though one aspect of the docs are confusing (at least to me):
Annotating a method with
@CaptureSpan creates a span as the child of the currently active span or transaction ([Span currentSpan()`).
When there is no current span, no span will be created.
I assume that the last line should say no span will be created if there is no current span or current transaction?
Yes, you are right, I've opened a small PR to fix this (will be visible in the next release).