Remove some other unknowns.
MODIFY
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/JDBCMaps.java
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/JDBCMaps.java
@@ -17,11 +17,11 @@ public class JDBCMaps {
Collections.synchronizedMap(new WeakHashMap<Connection, DBInfo>());
public static final Map<PreparedStatement, String> preparedStatements =
Collections.synchronizedMap(new WeakHashMap<PreparedStatement, String>());
- public static final String UNKNOWN_QUERY = "Unknown Query";
+ public static final String DB_QUERY = "DB Query";
@Data
public static class DBInfo {
- public static DBInfo UNKNOWN = new DBInfo("null", "database", null);
+ public static DBInfo DEFAULT = new DBInfo("null", "database", null);
private final String url;
private final String type;
private final String user;

MODIFY
dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/PreparedStatementInstrumentation.java
dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/PreparedStatementInstrumentation.java
@@ -66,7 +66,7 @@ public final class PreparedStatementInstrumentation extends Instrumenter.Configu
JDBCMaps.DBInfo dbInfo = JDBCMaps.connectionInfo.get(connection);
if (dbInfo == null) {
- dbInfo = JDBCMaps.DBInfo.UNKNOWN;
+ dbInfo = JDBCMaps.DBInfo.DEFAULT;
}
final Scope scope =
GlobalTracer.get().buildSpan(dbInfo.getType() + ".query").startActive(true);
@@ -77,7 +77,7 @@ public final class PreparedStatementInstrumentation extends Instrumenter.Configu
Tags.COMPONENT.set(span, "java-jdbc-prepared_statement");
span.setTag(DDTags.SERVICE_NAME, dbInfo.getType());
- span.setTag(DDTags.RESOURCE_NAME, sql == null ? JDBCMaps.UNKNOWN_QUERY : sql);
+ span.setTag(DDTags.RESOURCE_NAME, sql == null ? JDBCMaps.DB_QUERY : sql);
span.setTag(DDTags.SPAN_TYPE, "sql");
span.setTag("span.origin.type", statement.getClass().getName());
span.setTag("db.jdbc.url", dbInfo.getUrl());

MODIFY
dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/StatementInstrumentation.java
dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/StatementInstrumentation.java
@@ -66,7 +66,7 @@ public final class StatementInstrumentation extends Instrumenter.Configurable {
JDBCMaps.DBInfo dbInfo = JDBCMaps.connectionInfo.get(connection);
if (dbInfo == null) {
- dbInfo = JDBCMaps.DBInfo.UNKNOWN;
+ dbInfo = JDBCMaps.DBInfo.DEFAULT;
}
final Scope scope =

MODIFY
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInstrumentation.java
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInstrumentation.java
@@ -95,7 +95,7 @@ public final class KafkaConsumerInstrumentation extends Instrumenter.Configurabl
@Override
public void decorate(final Tracer.SpanBuilder spanBuilder, final ConsumerRecord record) {
- final String topic = record.topic() == null ? "unknown" : record.topic();
+ final String topic = record.topic() == null ? "kafka" : record.topic();
final SpanContext spanContext =
GlobalTracer.get()
.extract(Format.Builtin.TEXT_MAP, new TextMapExtractAdapter(record.headers()));

MODIFY
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerInstrumentation.java
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerInstrumentation.java
@@ -73,7 +73,7 @@ public final class KafkaProducerInstrumentation extends Instrumenter.Configurabl
callback = new ProducerCallback(callback, scope);
final Span span = scope.span();
- final String topic = record.topic() == null ? "unknown" : record.topic();
+ final String topic = record.topic() == null ? "kafka" : record.topic();
if (record.partition() != null) {
span.setTag("kafka.partition", record.partition());
}

Remove some other unknowns.