This commit is contained in:
Guillaume Polaert 2017-05-24 15:12:00 +02:00
parent 371cab8c02
commit 856a61ee4a
1 changed files with 9 additions and 9 deletions

View File

@ -124,15 +124,15 @@ class InstrumentedClass {
}
void methodSDK() {
// Retrieve the tracer using the resolver provided
// Make sure you have :
// 1. added the agent to the jvm (-javaagent;/path/to/agent.jar)
// 2. a dd-trace.yaml file in your resources directory
Tracer tracer = io.opentracing.util.GlobalTracer.get();
Span span = tracer.buildSpan("operation-name").build();
//Do some thing here ...
// Retrieve the tracer using the resolver provided
// Make sure you have :
// 1. added the agent to the jvm (-javaagent;/path/to/agent.jar)
// 2. a dd-trace.yaml file in your resources directory
Tracer tracer = io.opentracing.util.GlobalTracer.get();
Span span = tracer.buildSpan("operation-name").build();
//Do some thing here ...
Thread.sleep(1_000);
// Close the span, the trace will automatically reported to the writer configured