Last active
May 4, 2021 19:31
-
-
Save carlosalberto/08ff928d5c402f64b99609e6e620da4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.GlobalTracer; | |
public static void Main() { | |
// Don't create any extra objects, unless needed. | |
GlobalTracer.registerIfAbsent(TracerCallable.INSTANCE); | |
Span span = GlobalTracer.get().buildSpan("myOperation").start(); | |
} | |
class TracerCallable implements Callable<Tracer> { | |
public static final TracerCallable INSTANCE = new TracerCallable(); | |
@Override | |
public Tracer call(Tracer tracer) { | |
// Set configuration | |
Configuration configuration = new Configuration("foo"); | |
// Create Tracer | |
return configuration.getTracer(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment