-
I'm trying to make a simple example for how to do "inner" spans in Kotlin when using the javaagent. I'm used to NewRelic, where their terminology calls it If I understand it correctly this will do an inner span in Java. From here
AFAIK the above albeit verbose would work, but what confuses me is this line about it not working for Kotlin coroutines. I'm assuming the reason is a construct like the following?
and instead something like the following would work?
But what would I use if methodX isn't a suspend method? In that case I should use Second question is how -- edit: Thus far I've got the following methods. Would these work properly?
-- fixed the code to include span.end() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
There are a lot of questions in here, @tobias- . I'm not a kotlin expert at all, so let me ask you... does it work properly? If not, have you tried using the kotlin extension functions as suggested in the javadoc you referenced?
|
Beta Was this translation helpful? Give feedback.
-
Hey @tobias- good to see you here :) As far as the Kotlin usage you mentioned, your understanding sounds spot-on, in a suspending function you need to use |
Beta Was this translation helpful? Give feedback.
There are a lot of questions in here, @tobias- . I'm not a kotlin expert at all, so let me ask you... does it work properly?
If not, have you tried using the kotlin extension functions as suggested in the javadoc you referenced?
@WithSpan
will only work with the auto-instrumentation agent, so that sounds like a question for their discussions.