Update span types to be consistent with other tracers
MODIFY
dd-trace-api/src/main/java/datadog/trace/api/DDSpanTypes.java
dd-trace-api/src/main/java/datadog/trace/api/DDSpanTypes.java
package datadog.trace.api;
public class DDSpanTypes {
+ public static final String HTTP_SERVER = "http";
public static final String HTTP_CLIENT = "http";
public static final String WEB_SERVLET = "web";
public static final String RPC = "rpc";
+ public static final String CACHE = "cache";
public static final String SQL = "sql";
public static final String MONGO = "mongodb";
public static final String CASSANDRA = "cassandra";
+ public static final String REDIS = "redis";
+ public static final String MEMCACHED = "memcached";
+ public static final String ELASTICSEARCH = "elasticsearch";
public static final String MESSAGE_CONSUMER = "queue";
public static final String MESSAGE_PRODUCER = "queue";

MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/decorators/DBTypeDecorator.java
dd-trace-ot/src/main/java/datadog/opentracing/decorators/DBTypeDecorator.java
package datadog.opentracing.decorators;
import datadog.opentracing.DDSpanContext;
+import datadog.trace.api.DDSpanTypes;
import datadog.trace.api.DDTags;
import io.opentracing.tag.Tags;
@@ -25,13 +26,13 @@ public class DBTypeDecorator extends AbstractDecorator {
// Special case: Mongo, set to mongodb
if ("mongo".equals(value)) {
// Todo: not sure it's used cos already in the agent mongo helper
- context.setSpanType("mongodb");
+ context.setSpanType(DDSpanTypes.MONGO);
} else if ("cassandra".equals(value)) {
- context.setSpanType("cassandra");
+ context.setSpanType(DDSpanTypes.CASSANDRA);
} else if ("memcached".equals(value)) {
- context.setSpanType("cache");
+ context.setSpanType(DDSpanTypes.MEMCACHED);
} else {
- context.setSpanType("sql");
+ context.setSpanType(DDSpanTypes.SQL);
}
// Works for: mongo, cassandra, jdbc
context.setOperationName(String.valueOf(value) + ".query");

Update span types to be consistent with other tracers