Client span is generated here:
|
Span span = this.tracer.buildSpan(path(builder)) |
|
.asChildOf(tracer.activeSpan()) |
|
.withTag(Tags.COMPONENT.getKey(), COMPONENT) |
|
.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT) |
|
.withTag(ROUTE_ID, getRouteId(exchange)) |
|
.start(); |
Next we try to inject this span into Http Headers of inner request:
|
this.tracer.inject(span.context(), Format.Builtin.HTTP_HEADERS, new HttpHeadersCarrier(headersWithInput)); |
|
} catch (Exception ignore) { |
|
log.error("TraceRequestHttpHeadersFilter error", ignore); |
|
} |
|
headersWithInput.addAll(input); |
|
addHeadersWithInput(builder, headersWithInput); |
But if the incoming request to Spring Cloud Gateway had it own uber-trace-id header this will overwrite what we just tried to do. Is it a bug?
Client span is generated here:
java-spring-cloud/instrument-starters/opentracing-spring-cloud-gateway-starter/src/main/java/io/opentracing/contrib/spring/cloud/gateway/TraceRequestHttpHeadersFilter.java
Lines 55 to 60 in 8a865d5
Next we try to inject this span into Http Headers of inner request:
java-spring-cloud/instrument-starters/opentracing-spring-cloud-gateway-starter/src/main/java/io/opentracing/contrib/spring/cloud/gateway/TraceRequestHttpHeadersFilter.java
Lines 65 to 70 in 8a865d5
But if the incoming request to Spring Cloud Gateway had it own
uber-trace-idheader this will overwrite what we just tried to do. Is it a bug?