Hardcode additional tag names
MODIFY
dd-java-agent-ittests/src/test/groovy/com/datadoghq/agent/integration/servlet/JettyServletTest.groovy
dd-java-agent-ittests/src/test/groovy/com/datadoghq/agent/integration/servlet/JettyServletTest.groovy
package com.datadoghq.agent.integration.servlet
import com.datadoghq.trace.DDBaseSpan
-import com.datadoghq.trace.DDTags
import com.datadoghq.trace.DDTracer
import com.datadoghq.trace.writer.ListWriter
-import io.opentracing.tag.Tags
import io.opentracing.util.GlobalTracer
import okhttp3.Interceptor
import okhttp3.OkHttpClient
@@ -101,13 +99,13 @@ class JettyServletTest extends Specification {
span.context().operationName == "servlet.request"
!span.context().getErrorFlag()
span.context().parentId != 0 // parent should be the okhttp call.
- span.context().tags[Tags.HTTP_URL.key] == "http://localhost:$PORT/$path"
- span.context().tags[Tags.HTTP_METHOD.key] == "GET"
- span.context().tags[Tags.SPAN_KIND.key] == Tags.SPAN_KIND_SERVER
- span.context().tags[Tags.COMPONENT.key] == "java-web-servlet"
- span.context().tags[Tags.HTTP_STATUS.key] == 200
- span.context().tags[DDTags.THREAD_NAME] != null
- span.context().tags[DDTags.THREAD_ID] != null
+ span.context().tags["http.url"] == "http://localhost:$PORT/$path"
+ span.context().tags["http.method"] == "GET"
+ span.context().tags["span.kind"] == "server"
+ span.context().tags["component"] == "java-web-servlet"
+ span.context().tags["http.status_code"] == 200
+ span.context().tags["thread.name"] != null
+ span.context().tags["thread.id"] != null
span.context().tags.size() == 7
where:

MODIFY
dd-java-agent-ittests/src/test/groovy/com/datadoghq/agent/integration/servlet/TomcatServletTest.groovy
dd-java-agent-ittests/src/test/groovy/com/datadoghq/agent/integration/servlet/TomcatServletTest.groovy
package com.datadoghq.agent.integration.servlet
-import com.datadoghq.trace.DDTags
import com.datadoghq.trace.DDTracer
import com.datadoghq.trace.writer.ListWriter
import com.google.common.io.Files
-import io.opentracing.tag.Tags
import io.opentracing.util.GlobalTracer
import okhttp3.OkHttpClient
import okhttp3.Request
@@ -101,13 +99,13 @@ class TomcatServletTest extends Specification {
span.context().operationName == "servlet.request"
!span.context().getErrorFlag()
span.context().parentId != 0 // parent should be the okhttp call.
- span.context().tags[Tags.HTTP_URL.key] == "http://localhost:$PORT/$path"
- span.context().tags[Tags.HTTP_METHOD.key] == "GET"
- span.context().tags[Tags.SPAN_KIND.key] == Tags.SPAN_KIND_SERVER
- span.context().tags[Tags.COMPONENT.key] == "java-web-servlet"
- span.context().tags[Tags.HTTP_STATUS.key] == 200
- span.context().tags[DDTags.THREAD_NAME] != null
- span.context().tags[DDTags.THREAD_ID] != null
+ span.context().tags["http.url"] == "http://localhost:$PORT/$path"
+ span.context().tags["http.method"] == "GET"
+ span.context().tags["span.kind"] == "server"
+ span.context().tags["component"] == "java-web-servlet"
+ span.context().tags["http.status_code"] == 200
+ span.context().tags["thread.name"] != null
+ span.context().tags["thread.id"] != null
span.context().tags.size() == 7
where:

MODIFY
dd-java-agent-ittests/src/test/java/com/datadoghq/agent/TraceAnnotationsManagerTest.java
dd-java-agent-ittests/src/test/java/com/datadoghq/agent/TraceAnnotationsManagerTest.java
@@ -6,7 +6,6 @@ import com.datadoghq.agent.test.SayTracedHello;
import com.datadoghq.trace.DDTracer;
import com.datadoghq.trace.integration.ErrorFlag;
import com.datadoghq.trace.writer.ListWriter;
-import io.opentracing.tag.Tags;
import io.opentracing.util.GlobalTracer;
import java.lang.reflect.Field;
import org.junit.Before;
@@ -74,7 +73,7 @@ public class TraceAnnotationsManagerTest {
// DO NOTHING
}
assertThat(writer.firstTrace().get(0).getOperationName()).isEqualTo("ERROR");
- assertThat(writer.firstTrace().get(0).getTags().get(Tags.ERROR.getKey())).isEqualTo("true");
+ assertThat(writer.firstTrace().get(0).getTags().get("error")).isEqualTo("true");
assertThat(writer.firstTrace().get(0).getError()).isEqualTo(1);
}
}

MODIFY
dd-trace/src/test/java/com/datadoghq/trace/resolver/TracerResolverTest.java
dd-trace/src/test/java/com/datadoghq/trace/resolver/TracerResolverTest.java
@@ -9,7 +9,6 @@ import com.datadoghq.trace.integration.URLAsResourceName;
import io.opentracing.NoopTracerFactory;
import io.opentracing.Tracer;
import io.opentracing.contrib.tracerresolver.TracerResolver;
-import io.opentracing.tag.Tags;
import io.opentracing.util.GlobalTracer;
import java.lang.reflect.Field;
import java.util.List;
@@ -23,7 +22,7 @@ public class TracerResolverTest {
final DDTracer tracer = (DDTracer) tracerResolver.resolve();
// for HTTP decorators
- List<AbstractDecorator> decorators = tracer.getSpanContextDecorators(Tags.COMPONENT.getKey());
+ List<AbstractDecorator> decorators = tracer.getSpanContextDecorators("component");
assertThat(decorators.size()).isEqualTo(2);
AbstractDecorator decorator = decorators.get(0);
@@ -34,7 +33,7 @@ public class TracerResolverTest {
assertThat(httpServiceDecorator.getSetValue()).isEqualTo("world");
// for URL decorators
- decorators = tracer.getSpanContextDecorators(Tags.HTTP_URL.getKey());
+ decorators = tracer.getSpanContextDecorators("http.url");
assertThat(decorators.size()).isEqualTo(1);
decorator = decorators.get(0);

Hardcode additional tag names