Updating example
This commit is contained in:
parent
4072edb405
commit
03e1ea9014
|
@ -1,15 +1,17 @@
|
||||||
import com.datadoghq.trace.DDTracer;
|
import com.datadoghq.trace.DDTracer;
|
||||||
|
import com.datadoghq.trace.Service;
|
||||||
import com.datadoghq.trace.sampling.AllSampler;
|
import com.datadoghq.trace.sampling.AllSampler;
|
||||||
import com.datadoghq.trace.writer.LoggingWriter;
|
import com.datadoghq.trace.writer.LoggingWriter;
|
||||||
import io.opentracing.Span;
|
import io.opentracing.Span;
|
||||||
|
|
||||||
public class ExampleWithLoggingWriter {
|
public class ExampleWithLoggingWriter {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(final String[] args) throws Exception {
|
||||||
|
|
||||||
DDTracer tracer = new DDTracer(new LoggingWriter(), new AllSampler());
|
final DDTracer tracer = new DDTracer(new LoggingWriter(), new AllSampler());
|
||||||
|
tracer.addServiceInfo(new Service("service-foo", "mongo", Service.AppType.DB));
|
||||||
|
|
||||||
Span parent =
|
final Span parent =
|
||||||
tracer
|
tracer
|
||||||
.buildSpan("hello-world")
|
.buildSpan("hello-world")
|
||||||
.withServiceName("service-name")
|
.withServiceName("service-name")
|
||||||
|
@ -20,7 +22,7 @@ public class ExampleWithLoggingWriter {
|
||||||
|
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
|
|
||||||
Span child =
|
final Span child =
|
||||||
tracer
|
tracer
|
||||||
.buildSpan("hello-world")
|
.buildSpan("hello-world")
|
||||||
.asChildOf(parent)
|
.asChildOf(parent)
|
||||||
|
|
Loading…
Reference in New Issue