opentracing / opentracing-java

OpenTracing API for Java. 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io
Apache License 2.0
1.68k stars 344 forks source link

Add simple registerIfAbsent to global tracer #289

Closed pavolloffay closed 5 years ago

pavolloffay commented 6 years ago

Resolves https://github.com/opentracing/opentracing-java/issues/286

Signed-off-by: Pavol Loffay ploffay@redhat.com

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 76.632% when pulling 8cd1dff6878c9f8e0f14586b4d40a18b650b5272 on pavolloffay:globaltracer-register into 9b6ca36d8920d40e14cbf24e70ae7fbf3956296c on opentracing:v0.32.0.

pavolloffay commented 6 years ago

cc @opentracing/opentracing-java-maintainers

pavolloffay commented 5 years ago

@sjoerdtalsma I have added a commit fixing your comment and also fixing other javadoc (referencing deprecated method)

pavolloffay commented 5 years ago

I have changed the target branch to v0.32.0

carlosalberto commented 5 years ago

@sjoerdtalsma Is this good to go? If yes, please merge it so this can be included in RC1 ;)

sjoerdtalsma commented 5 years ago

I still don't understand the following javadoc:

Use {@link #registerIfAbsent(Callable)} for use cases when the tracer can be instantiated multiple times.

Where does GlobalTracer say anything about instantiating multiple times? The callable use case is for guaranteed 'at most once' initialization. You may also call it Lazy initialization. I don't want to block for a javadoc comment, but I get more questions than answers when reading this.

sjoerdtalsma commented 5 years ago

LGTM, :ship: it

carlosalberto commented 5 years ago

Awesome! Will be including this change in RC1 ;)