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

Async @WithSpan Instrumentation for Guava ListenableFuture #2811

Merged
merged 7 commits into from Apr 28, 2021

Conversation

HaloFour
Copy link
Contributor

Adds AsyncSpanEndStrategy that ends the span for a method annotated with @WithSpan when the returned Guava ListenableFuture is completed.

import io.opentelemetry.instrumentation.api.tracer.async.AsyncSpanEndStrategies;
import io.opentelemetry.instrumentation.guava.GuavaAsyncSpanEndStrategy;

public class InstrumentationHelper {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can you make it final and add a private constructor?

AsyncSpanEndStrategies.getInstance().registerStrategy(GuavaAsyncSpanEndStrategy.INSTANCE);
}

public static void initialize() {}
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment explaining why it is important to call this method even if it does nothin (static initializer on class load)

@iNikem iNikem merged commit 5c15f5e into open-telemetry:main Apr 28, 2021
@HaloFour HaloFour deleted the withspan-async-guava branch July 17, 2021 01:02
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.

None yet

3 participants