Adding some comments and a missing dep
MODIFY
pom.xml
pom.xml
<version>2.7.22</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>io.opentracing.contrib</groupId>
+ <artifactId>opentracing-agent</artifactId>
+ <version>RELEASE</version>
+ </dependency>
</dependencies>
<build>

MODIFY
src/main/java/com/datadoghq/trace/integration/DBServiceDecorator.java
src/main/java/com/datadoghq/trace/integration/DBServiceDecorator.java
@@ -4,6 +4,10 @@ import com.datadoghq.trace.DDSpanContext;
import io.opentracing.tag.Tags;
+/**
+ * This span decorator leverages DB tags. It allows the dev to define a custom
+ * service name and retrieves some DB meta such as the statement
+ */
public class DBServiceDecorator implements DDSpanContextDecorator {
protected final String componentName;

MODIFY
src/main/java/com/datadoghq/trace/integration/HTTPServiceDecorator.java
src/main/java/com/datadoghq/trace/integration/HTTPServiceDecorator.java
@@ -7,6 +7,11 @@ import com.datadoghq.trace.DDSpanContext;
import io.opentracing.tag.Tags;
+
+/**
+ * This span decorator leverages HTTP tags. It allows the dev to define a custom
+ * service name and retrieves some HTTP meta such as the request path
+ */
public class HTTPServiceDecorator implements DDSpanContextDecorator {
protected final String componentName;

MODIFY
src/main/java/com/datadoghq/trace/integration/MapperDecorator.java
src/main/java/com/datadoghq/trace/integration/MapperDecorator.java
@@ -6,7 +6,7 @@ import com.datadoghq.trace.DDSpanContext;
import com.datadoghq.trace.DDTags;
/**
- * Remap some tags to other tags
+ * This is a generic decorator, it remaps some tags to other tags
*/
public class MapperDecorator implements DDSpanContextDecorator {

MODIFY
src/main/java/com/datadoghq/trace/propagation/Codec.java
src/main/java/com/datadoghq/trace/propagation/Codec.java
@@ -23,9 +23,26 @@ package com.datadoghq.trace.propagation;
import com.datadoghq.trace.DDSpanContext;
+
+/**
+ * A codec is a simple object that can encode and decode a span context through a carrier
+ */
public interface Codec<T> {
+
+ /**
+ * Serialize the span context using the provided carrier
+ *
+ * @param context
+ * @param carrier
+ */
void inject(DDSpanContext context, T carrier);
+ /**
+ * Given a carrier, retrieve (rebuild) a span context. This context built will be use as the parent
+ *
+ * @param carrier
+ * @return the span context
+ */
DDSpanContext extract(T carrier);
}

MODIFY
src/main/java/com/datadoghq/trace/propagation/HTTPCodec.java
src/main/java/com/datadoghq/trace/propagation/HTTPCodec.java
@@ -13,7 +13,9 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-
+/**
+ * A codec designed for HTTP transport via headers
+ */
public class HTTPCodec implements Codec<TextMap> {
private static final String OT_PREFIX = "ot-tracer-";
@@ -34,8 +36,6 @@ public class HTTPCodec implements Codec<TextMap> {
}
}
-
-
@Override
public DDSpanContext extract(TextMap carrier) {
@@ -74,7 +74,6 @@ public class HTTPCodec implements Codec<TextMap> {
null);
logger.debug("{} - Parent context extracted", context);
-
}
return context;

ADD
src/main/resources/dd-trace.yaml
+defaultServiceName: unnamed-java-app
+writer:
+ type: DDAgentWriter
+ host: localhost
+ port: 8126
+sampler:
+ type: AllSampler
+#decorators:
+# - type: HTTPServiceDecorator
+# componentName: hello
+# desiredServiceName: world
+
+
\ No newline at end of file

Adding some comments and a missing dep