Adjust tag naming for better consistency
MODIFY
dd-trace/src/main/java/com/datadoghq/trace/DDTags.java
dd-trace/src/main/java/com/datadoghq/trace/DDTags.java
package com.datadoghq.trace;
public class DDTags {
- public static final String SPAN_TYPE = "span-type";
- public static final String SERVICE_NAME = "service-name";
- public static final String RESOURCE_NAME = "resource-name";
- public static final String THREAD_NAME = "thread-name";
- public static final String THREAD_ID = "thread-id";
+ public static final String SPAN_TYPE = "span.type";
+ public static final String SERVICE_NAME = "service.name";
+ public static final String RESOURCE_NAME = "resource.name";
+ public static final String THREAD_NAME = "thread.name";
+ public static final String THREAD_ID = "thread.id";
public static final String DB_STATEMENT = "sql.query";
}

MODIFY
dd-trace/src/test/groovy/com/datadoghq/trace/writer/DDApiTest.groovy
dd-trace/src/test/groovy/com/datadoghq/trace/writer/DDApiTest.groovy
package com.datadoghq.trace.writer
+import com.datadoghq.trace.DDTags
import com.datadoghq.trace.Service
import com.datadoghq.trace.SpanFactory
import com.fasterxml.jackson.core.type.TypeReference
@@ -89,7 +90,7 @@ class DDApiTest extends Specification {
[SpanFactory.newSpanOf(1L)] | [new TreeMap<>([
"duration" : 0,
"error" : 0,
- "meta" : ["thread-name": Thread.currentThread().getName(), "thread-id": "${Thread.currentThread().id}"],
+ "meta" : [(DDTags.THREAD_NAME): Thread.currentThread().getName(), (DDTags.THREAD_ID): "${Thread.currentThread().id}"],
"name" : "fakeOperation",
"parent_id": 0,
"resource" : "fakeResource",
@@ -102,7 +103,7 @@ class DDApiTest extends Specification {
[SpanFactory.newSpanOf(100L)] | [new TreeMap<>([
"duration" : 0,
"error" : 0,
- "meta" : ["thread-name": Thread.currentThread().getName(), "thread-id": "${Thread.currentThread().id}"],
+ "meta" : [(DDTags.THREAD_NAME): Thread.currentThread().getName(), (DDTags.THREAD_ID): "${Thread.currentThread().id}"],
"name" : "fakeOperation",
"parent_id": 0,
"resource" : "fakeResource",

MODIFY
dd-trace/src/test/java/com/datadoghq/trace/DDSpanSerializationTest.java
dd-trace/src/test/java/com/datadoghq/trace/DDSpanSerializationTest.java
@@ -50,8 +50,8 @@ public class DDSpanSerializationTest {
null,
null);
- baggage.put("thread-name", Thread.currentThread().getName());
- baggage.put("thread-id", String.valueOf(Thread.currentThread().getId()));
+ baggage.put(DDTags.THREAD_NAME, Thread.currentThread().getName());
+ baggage.put(DDTags.THREAD_ID, String.valueOf(Thread.currentThread().getId()));
span = new DDSpan(100L, context);
span.finish(133L);

Adjust tag naming for better consistency