-
Notifications
You must be signed in to change notification settings - Fork 873
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
Conversation
import io.opentelemetry.instrumentation.api.tracer.async.AsyncSpanEndStrategies; | ||
import io.opentelemetry.instrumentation.guava.GuavaAsyncSpanEndStrategy; | ||
|
||
public class InstrumentationHelper { |
There was a problem hiding this comment.
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() {} |
There was a problem hiding this comment.
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)
Adds AsyncSpanEndStrategy that ends the span for a method annotated with
@WithSpan
when the returned Guava ListenableFuture is completed.