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

Different behaviour, hard to control between implementations #156

Closed
maciej-gromul opened this issue Mar 3, 2023 · 0 comments · Fixed by #159
Closed

Different behaviour, hard to control between implementations #156

maciej-gromul opened this issue Mar 3, 2023 · 0 comments · Fixed by #159
Labels
bug Something isn't working
Milestone

Comments

@maciej-gromul
Copy link
Contributor

Current otel implementation is behaving differently than default one with brave tracer. Brave tracer when it get's extracted parent context through propagator creates a new span with parent context connected. When you open scope for that span, any new span will be connected with that new span.

Because in otel the OtelSpanInScope changes context to parent context when creating new span it's like having a child span but the scope is always to it's parent. It's even different with the builder where BraveBuilder simply creates new span with parent context, while otel returns after calling start a new span with method return of

if (this.parentContext != null) {
  return OtelSpan.fromOtel(new SpanFromSpanContext(span, span.getSpanContext(), (OtelTraceContext) this.parentContext));
}

So for brave if we get kafka record with b3 headers of 000000000000000a-000000000000000b-1-000000000000000a, method extract gives us a child span of random spanId connected with trace id 000000000000000a, and if we use tracer.withSpan(child) we will have that child as a scope and current trace context.

In case of otel calling tracer.withSpan(child) will have parent span and trace context as current span and trace context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants