Fix size calculations and improve DDTracerTest
MODIFY
dd-trace-api/src/main/java/datadog/trace/api/Config.java
dd-trace-api/src/main/java/datadog/trace/api/Config.java
@@ -182,10 +182,13 @@ public class Config {
}
public Map<String, String> getMergedJmxTags() {
- final Map<String, String> result = newHashMap(globalTags.size() + jmxTags.size() + 1);
+ final Map<String, String> runtimeTags = getRuntimeTags();
+ final Map<String, String> result =
+ newHashMap(
+ globalTags.size() + jmxTags.size() + runtimeTags.size() + 1 /* for serviceName */);
result.putAll(globalTags);
result.putAll(jmxTags);
- result.putAll(getRuntimeTags());
+ result.putAll(runtimeTags);
// service name set here instead of getRuntimeTags because apm already manages the service tag
// and may chose to override it.
result.put(SERVICE_NAME, serviceName);

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/DDTracerTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/DDTracerTest.groovy
@@ -121,7 +121,8 @@ class DDTracerTest extends Specification {
tracer.serviceName == DEFAULT_SERVICE_NAME
tracer.sampler == sampler
tracer.writer == writer
- tracer.runtimeTags.size() > 0
+ tracer.runtimeTags[Config.RUNTIME_ID_TAG].size() > 0 // not null or empty
+ tracer.runtimeTags[Config.LANGUAGE_TAG_KEY] == Config.LANGUAGE_TAG_VALUE
}
def "Shares TraceCount with DDApi with #key = #value"() {

Fix size calculations and improve DDTracerTest