Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uber-trace-id from incoming request overwrites client span in spring cloud gateway tracing #340

Open
rafis opened this issue Jan 23, 2023 · 0 comments · May be fixed by #341
Open

uber-trace-id from incoming request overwrites client span in spring cloud gateway tracing #340

rafis opened this issue Jan 23, 2023 · 0 comments · May be fixed by #341

Comments

@rafis
Copy link

rafis commented Jan 23, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant