Add comments and remove unneeded code.
This commit is contained in:
parent
a603eee841
commit
188bdf498f
|
@ -564,14 +564,7 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
|
||||||
|
|
||||||
// Get header tags whether propagating or not.
|
// Get header tags whether propagating or not.
|
||||||
if (parentContext instanceof TagContext) {
|
if (parentContext instanceof TagContext) {
|
||||||
final TagContext tagContext = (TagContext) parentContext;
|
tags.putAll(((TagContext) parentContext).getTags());
|
||||||
|
|
||||||
if (tags.isEmpty() && !tagContext.getTags().isEmpty()) {
|
|
||||||
tags = new HashMap<>();
|
|
||||||
}
|
|
||||||
if (!tagContext.getTags().isEmpty()) {
|
|
||||||
tags.putAll(tagContext.getTags());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
tags.put(Config.RUNTIME_ID_TAG, runtimeId);
|
tags.put(Config.RUNTIME_ID_TAG, runtimeId);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@ package datadog.opentracing.propagation;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Propagated data resulting from calling tracer.extract with header data from an incoming request.
|
||||||
|
*/
|
||||||
public class ExtractedContext extends TagContext {
|
public class ExtractedContext extends TagContext {
|
||||||
private final String traceId;
|
private final String traceId;
|
||||||
private final String spanId;
|
private final String spanId;
|
||||||
|
|
|
@ -4,6 +4,10 @@ import io.opentracing.SpanContext;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When calling extract, we allow for grabbing other configured headers as tags. Those tags are
|
||||||
|
* returned here even if the rest of the request would have returned null.
|
||||||
|
*/
|
||||||
public class TagContext implements SpanContext {
|
public class TagContext implements SpanContext {
|
||||||
private final Map<String, String> tags;
|
private final Map<String, String> tags;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue