apm-agent-java icon indicating copy to clipboard operation
apm-agent-java copied to clipboard

Support Kotlin Coroutines

Open bastrich opened this issue 3 years ago • 2 comments

Currently Elastic Apm Java Agent doesn't support tracing context inside Kotlin Coroutines. And when you use Elastic Apm in Kotlin project, tracing doesn't work inside coroutines. So it would be quite useful to have Elastic Apm suppurt for Kotlin Coroutines.

I think the best solution is to implement Elastic Apm Java Agent Plugin for supporting Kotlin Coroutines.

Alternatively we can pass tracing context manually to kotlin coroutine context. But that doesn't allow other plugins to work correctly and adds a lot of boilerplate code.

bastrich avatar Aug 06 '21 18:08 bastrich

Any news on this?

samuelbirocchi avatar Jun 01 '22 22:06 samuelbirocchi

Hi Kotliners. It's unlikely that Elastic will put resources into this any time soon. Ideally the Kotlin community would add this into the agent. Here's some options

  1. We've recently published a Plugin API with examples which maybe would assist adding this capability
  2. Or more effortful would be a PR adding a plugin directly in the agent in this repo
  3. Elastic APM accepts OpenTelemetry comms, so if there is an OpenTelemetry Kotlin agent that instruments coroutines, that might be an option

jackshirazi avatar Jul 11 '22 10:07 jackshirazi