Slide 51
Slide 51 text
class Foo {
private static final Tracer tracer = Tracing.getTracer();
public static void main(String ...args) {
try {
setupOpenCensusAndStackdriverExporter();
} catch (IOException e) {
return;
}
yourMethod()
}
void yourMethod() {
try (Scope ss = tracer.spanBuilder("yourMethod").startScopedSpan()) {
//
Span span = tracer.getCurrentSpan();
span.addAnnotation("name_of_tag", "foobarbaz");
}
}
}