Early Adopter
OpenTracing is an open source project that provides APIs and instrumentation for distributed tracing. Although OpenTracing and OpenCensus merged in 2019 to form OpenTelemetry, OpenTracing instrumentations are still used by many popular frameworks, libraries, and projects.
Dynatrace OneAgent for Java automatically collects OpenTracing span data and integrates it into end-to-end PurePath® distributed traces. OpenTracing with OneAgent enables you to:
The quality of the OpenTracing spans captured by OneAgent depends on the quality of instrumentation provided by the third-party library.
To enable support for capturing span data
GlobalTracer
and thereby override other tracers that are registered in the application. Select this setting only if you're sure that you want to override the other tracers (for example, Jaeger) in your tracing system.GlobalTracer
when no other tracer is registered in the application. Do this if you don't want to interfere with any other tracers in your tracing system.GlobalTracer.get()
to create spans.
The following sample shows how to manually create spans with OpenTracing:
// Make sure to use the correct Tracer.Tracer tracer = GlobalTracer.get();SpanBuilder spanBuilder = tracer.buildSpan("hello");spanBuilder.withTag("foo", "bar");Span span = spanBuilder.start();// Make sure to close every created Scope.// It is recommended to use a try-with-resource statement for that.try (Scope scope = tracer.activateSpan(span)) {// Do actual operation.} finally {// Make sure to finish every started Span.span.finish();}
HazelcastInstance untraced = HazelcastClient.newHazelcastClient();// This operation will not be visible in Dynatrace.untraced.getMap("map").put("key", "value");// TracingHazelcastInstance implements the same interface (HazelcastInstance)// but automatially creates span for every operation.// It internally calls GlobalTracer.get().// Available as a separate instrumentation scope/library:// https://github.com/opentracing-contrib/java-hazelcastHazelcastInstance traced = new TracingHazelcastInstance(HazelcastClient.newHazelcastClient(),false // traceWithActiveSpanOnly);// This operation will be visible in Dynatrace.traced.getMap("map").put("key", "value");
See Span settings for all configuration options.
array
-type attributes.Dynatrace integrates traces from any OpenTracing instrumentations. We have positively tested the instrumentation of the following libraries and frameworks: