I'm just beginner with Jaeger implementation and want to know how can I controll if span
can be instantiated based on flag=true
Below, is sample logic I'm trying to put behind the flag condition?
try (Scope scope = tracer.scopeManager().activate(span, true)) {
System.out.println("The code will come here");
for (int i = 0; i < 100; i++) {
System.out.println("code working...");
}
} finally {
span.finish();
}
if instantiating in other class
if (FLAG) {
tracer = TryFeatureFlag.initTracer();
span = tracer.buildSpan("inside-timepass").start();
}