-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Akka/Pekko after loses thread context propagation #11755
Comments
I think this is because the final def schedule(initialDelay: FiniteDuration, interval: FiniteDuration)(f: => Unit)(
implicit
executor: ExecutionContext): Cancellable =
schedule(initialDelay, interval, new Runnable { override def run(): Unit = f }) |
I think I am having an issue with the
Can you elaborate how you manage to do this with |
Thank you. I wonder if it is possible to fix this with an update to the auto-instrumentation library? It is hard to catch usages of all those scheduler actions in code. |
Side note, we might need to instrument all https://github.com/search?q=repo%3Aapache%2Fpekko%20%22new%20Runnable%22&type=code I am pretty new to OTEL instrumentation so I don't have a deep understanding in how we might want to do it but I can try once I have some spare time. |
For reference, I have created a unit test in this commit: I am not entirely sure how I should create the instrumentation feature. |
Describe the bug
The after pattern causes the instrumentation to get confused. This is related to the execution context provided. To make it work, manual wrapping must be used.
Steps to reproduce
https://github.com/wsargent/akka-after-loses-otel-thread-context
Expected behavior
The after pattern carries over the existing span context.
Actual behavior
Javaagent or library instrumentation version
1.39.0
Environment
JDK:
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
OS:
Linux devserver 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Additional context
https://github.com/wsargent/opentelemetry-with-scala-futures
The text was updated successfully, but these errors were encountered: