Make internal name usage consistent with setting name.
MODIFY
dd-trace-api/src/main/java/datadog/trace/api/Config.java
dd-trace-api/src/main/java/datadog/trace/api/Config.java
@@ -79,7 +79,7 @@ public class Config {
private static final boolean DEFAULT_PRIORITY_SAMPLING_ENABLED = true;
private static final boolean DEFAULT_TRACE_RESOLVER_ENABLED = true;
private static final boolean DEFAULT_HTTP_CLIENT_SPLIT_BY_DOMAIN = false;
- private static final int DEFAULT_MAX_TRACE_SIZE_BEFORE_PARTIAL_FLUSH = 0;
+ private static final int DEFAULT_PARTIAL_FLUSH_MIN_SPANS = 0;
private static final boolean DEFAULT_JMX_FETCH_ENABLED = false;
public static final int DEFAULT_JMX_FETCH_STATSD_PORT = 8125;
@@ -143,8 +143,7 @@ public class Config {
HTTP_CLIENT_HOST_SPLIT_BY_DOMAIN, DEFAULT_HTTP_CLIENT_SPLIT_BY_DOMAIN);
partialFlushMinSpans =
- getIntegerSettingFromEnvironment(
- PARTIAL_FLUSH_MIN_SPANS, DEFAULT_MAX_TRACE_SIZE_BEFORE_PARTIAL_FLUSH);
+ getIntegerSettingFromEnvironment(PARTIAL_FLUSH_MIN_SPANS, DEFAULT_PARTIAL_FLUSH_MIN_SPANS);
runtimeContextFieldInjection =
getBooleanSettingFromEnvironment(

MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java
dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java
@@ -64,7 +64,7 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
private final Map<String, String> serviceNameMappings;
/** number of spans in a pending trace before they get flushed */
- @Getter private final int maxTraceSizeBeforePartialFlush;
+ @Getter private final int partialFlushMinSpans;
/**
* JVM shutdown callback, keeping a reference to it to remove this if DDTracer gets destroyed
@@ -178,7 +178,7 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
defaultSpanTags,
serviceNameMappings,
taggedHeaders,
- defaultMaxTraceSizeBeforePartialFlush());
+ Config.get().getPartialFlushMinSpans());
}
/**
@@ -201,7 +201,7 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
defaultSpanTags,
serviceNameMappings,
taggedHeaders,
- defaultMaxTraceSizeBeforePartialFlush());
+ Config.get().getPartialFlushMinSpans());
}
public DDTracer(
@@ -212,7 +212,7 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
final Map<String, String> defaultSpanTags,
final Map<String, String> serviceNameMappings,
final Map<String, String> taggedHeaders,
- final int maxTraceSizeBeforePartialFlush) {
+ final int partialFlushMinSpans) {
assert runtimeTags != null;
assert defaultSpanTags != null;
assert serviceNameMappings != null;
@@ -225,7 +225,7 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
this.defaultSpanTags = defaultSpanTags;
this.runtimeTags = runtimeTags;
this.serviceNameMappings = serviceNameMappings;
- this.maxTraceSizeBeforePartialFlush = maxTraceSizeBeforePartialFlush;
+ this.partialFlushMinSpans = partialFlushMinSpans;
shutdownCallback =
new Thread() {
@@ -446,11 +446,6 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
return Collections.unmodifiableMap(runtimeTags);
}
- @Deprecated
- private static int defaultMaxTraceSizeBeforePartialFlush() {
- return Config.get().getPartialFlushMinSpans();
- }
-
/** Spans are built using this builder */
public class DDSpanBuilder implements SpanBuilder {
private final ScopeManager scopeManager;

MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/PendingTrace.java
dd-trace-ot/src/main/java/datadog/opentracing/PendingTrace.java
@@ -199,10 +199,9 @@ public class PendingTrace extends ConcurrentLinkedDeque<DDSpan> {
if (count == 0) {
write();
} else {
- if (tracer.getMaxTraceSizeBeforePartialFlush() > 0
- && size() > tracer.getMaxTraceSizeBeforePartialFlush()) {
+ if (tracer.getPartialFlushMinSpans() > 0 && size() > tracer.getPartialFlushMinSpans()) {
synchronized (this) {
- if (size() > tracer.getMaxTraceSizeBeforePartialFlush()) {
+ if (size() > tracer.getPartialFlushMinSpans()) {
final DDSpan rootSpan = getRootSpan();
final List<DDSpan> partialTrace = new ArrayList(size());
final Iterator<DDSpan> it = iterator();

Make internal name usage consistent with setting name.