diff --git a/pom.xml b/pom.xml index a233902a82..5eeabfd896 100644 --- a/pom.xml +++ b/pom.xml @@ -7,12 +7,36 @@ raclette-java 1.0-SNAPSHOT + + 0.22.0 + + + + io.opentracing opentracing-api - 0.21.0 + ${opentracing.version} + + io.opentracing + opentracing-noop + ${opentracing.version} + + + io.opentracing + opentracing-util + ${opentracing.version} + + + + + io.opentracing.contrib + opentracing-tracerresolver + 0.1.0 + + com.fasterxml.jackson.core jackson-databind @@ -41,12 +65,7 @@ 4.9 - - - io.opentracing.contrib - opentracing-tracerresolver - 0.1.0 - + com.google.auto.service @@ -73,12 +92,7 @@ 2.7.22 test - - io.opentracing.contrib - opentracing-agent - RELEASE - - + diff --git a/src/main/java/com/datadoghq/trace/resolver/DDTracerResolver.java b/src/main/java/com/datadoghq/trace/resolver/DDTracerResolver.java index 609cebba3a..292f0f01bd 100644 --- a/src/main/java/com/datadoghq/trace/resolver/DDTracerResolver.java +++ b/src/main/java/com/datadoghq/trace/resolver/DDTracerResolver.java @@ -34,10 +34,6 @@ public class DDTracerResolver extends TracerResolver { private final static Logger logger = LoggerFactory.getLogger(DDTracerResolver.class); -// private static final ServiceLoader WRITERS = ServiceLoader.load(Writer.class); -// private static final ServiceLoader SAMPLERS = ServiceLoader.load(Sampler.class); -// private static final ServiceLoader DECORATORS = ServiceLoader.load(DDSpanContextDecorator.class); - public static final String TRACER_CONFIG = "dd-trace.yaml"; private final ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); @@ -129,10 +125,10 @@ public class DDTracerResolver extends TracerResolver { } if (tracer == null) { - tracer = NoopTracerFactory.create(); + tracer = NoopTracerFactory.create(); } GlobalTracer.register(tracer); - return tracer; + return tracer; } } diff --git a/src/main/resources/dd-trace.yaml b/src/main/resources/dd-trace.yaml index dc4d1433b3..fb9d6b50fd 100644 --- a/src/main/resources/dd-trace.yaml +++ b/src/main/resources/dd-trace.yaml @@ -1,13 +1,36 @@ +# Service name used if none is provided in the app defaultServiceName: unnamed-java-app + +# The writer to use. +# Could be: LoggingWritter or DDAgentWriter (default) writer: + # LoggingWriter: Spans are logged using the application configuration + # DDAgentWriter: Spans are forwarding to a Datadog Agent + # - Param 'host': the hostname where the DD Agent running (default: localhost) + # - Param 'port': the port to reach the DD Agent (default: 8126) type: DDAgentWriter host: localhost port: 8126 + +# The sampler to use. +# Could be: AllSampler (default) or RateSampler sampler: + # AllSampler: all spans are reported to the writer + # RateSample: only a portion of spans are reported to the writer + # - Param 'rate': the portion of spans to keep type: AllSampler -#decorators: -# - type: HTTPServiceDecorator -# componentName: hello -# desiredServiceName: world - + +# Decorators are used to add extra information to span +# Could be DBServiceDecorator, MapperDecorator or HTTPServiceDecorator +decorators: + + # This span decorator leverages HTTP tags such as the URL requested + - type: HTTPServiceDecorator + componentName: http + desiredServiceName: unnamed-java-http + + # This span decorator leverages DB tags such as the statement requested + - type: DBServiceDecorator + componentName: db + desiredServiceName: unnamed-java-db \ No newline at end of file