Skip to content

Commit 8e02208

Browse files
committed
Do not overwrite client span if incoming request has "uber-trace-id" header
1 parent 8a865d5 commit 8e02208

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

instrument-starters/opentracing-spring-cloud-gateway-starter/src/main/java/io/opentracing/contrib/spring/cloud/gateway/TraceRequestHttpHeadersFilter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public HttpHeaders filter(HttpHeaders input, ServerWebExchange exchange) {
6666
} catch (Exception ignore) {
6767
log.error("TraceRequestHttpHeadersFilter error", ignore);
6868
}
69-
headersWithInput.addAll(input);
69+
for (Map.Entry<String, List<String>> entry : input.entrySet()) {
70+
headersWithInput.addIfAbsent(entry.getKey(), entry.getValue().get(0));
71+
}
7072
addHeadersWithInput(builder, headersWithInput);
7173
return headersWithInput;
7274
}

0 commit comments

Comments
 (0)