Skip to content
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

Improve Akka instrumentation #2737

Merged
merged 1 commit into from
Apr 7, 2021
Merged

Improve Akka instrumentation #2737

merged 1 commit into from
Apr 7, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Apr 6, 2021

Attach context to Akka message and restore it before invoking target method to ensure it runs with correct parent context.

@@ -34,6 +38,7 @@ public AkkaActorInstrumentationModule() {
map.put(Runnable.class.getName(), State.class.getName());
map.put(Callable.class.getName(), State.class.getName());
map.put(AkkaForkJoinTaskInstrumentation.TASK_CLASS_NAME, State.class.getName());
map.put("akka.dispatch.Envelope", State.class.getName());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not "Envelope.class.getName()" ? AFAIK the class is available for reference at this point. Not that it changes a lot ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the class isn't available. InstrumentationModule instances are loaded by AgentClassLoader so they can only see what jdk has and the things that are bundled inside agent.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That explains a lot ;)

@trask trask merged commit 443f974 into open-telemetry:main Apr 7, 2021
@laurit laurit deleted the akka branch August 24, 2021 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants