Polish
This commit is contained in:
@@ -71,16 +71,14 @@ public class ZipkinHttpSpanExtractor implements HttpSpanExtractor {
|
||||
String parentName = carrier.get(Span.SPAN_NAME_NAME);
|
||||
if (StringUtils.hasText(parentName)) {
|
||||
span.name(parentName);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
span.name(HTTP_COMPONENT + ":/parent" + uri);
|
||||
}
|
||||
if (StringUtils.hasText(processId)) {
|
||||
span.processId(processId);
|
||||
}
|
||||
if (carrier.containsKey(Span.PARENT_ID_NAME)) {
|
||||
span.parent(Span
|
||||
.hexToId(carrier.get(Span.PARENT_ID_NAME)));
|
||||
span.parent(Span.hexToId(carrier.get(Span.PARENT_ID_NAME)));
|
||||
}
|
||||
span.remote(true);
|
||||
if (skip) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.springframework.cloud.sleuth.instrument.web;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.cloud.sleuth.HttpSpanInjector;
|
||||
import org.springframework.cloud.sleuth.Span;
|
||||
import org.springframework.cloud.sleuth.SpanTextMap;
|
||||
@@ -30,7 +28,7 @@ public class ZipkinHttpSpanInjector implements HttpSpanInjector {
|
||||
}
|
||||
|
||||
private void setHeader(SpanTextMap carrier, String name, String value) {
|
||||
if (StringUtils.hasText(value) && !entryPresent(carrier, name)) {
|
||||
if (StringUtils.hasText(value)) {
|
||||
carrier.put(name, value);
|
||||
}
|
||||
}
|
||||
@@ -41,13 +39,4 @@ public class ZipkinHttpSpanInjector implements HttpSpanInjector {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean entryPresent(SpanTextMap carrier, String name) {
|
||||
for (Map.Entry<String, String> entry : carrier) {
|
||||
if (entry.getKey().equals(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user