You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used to use the ChildOf option to inject a parent context extracted from a message or an HTTP request but the option is not deprecated in favor of StartChild but we cannot instantiate the parent span from the parent context and we end up doing this:
@Gilthoniel Thanks for reaching out! ChildOf was deprecated but it's still available. The way you modified your code is correct, but we agree it can bee a bit cumbersome. We'll discuss your case internally to see how can be improve this specific case.
// Then, on the server side, to continue the trace one would do://// sctx, err := tracer.Extract(tracer.HTTPHeadersCarrier(req.Header))// // ...// span := tracer.StartSpan("child.span", tracer.ChildOf(sctx))
Is the method above the only way to "continue" a trace from a given spancontext parent?
darccio
added
enhancement
quick change/addition that does not need full team approval
and removed
bug
unintended behavior that has to be fixed
labels
Jun 10, 2025
darccio
changed the title
[BUG]: cannot start span with a parent context anymore in v2
Lack of convenient API to start span with a parent context in v2
Jun 10, 2025
Tracer Version(s)
v2.0.0
Go Version(s)
go v1.24.3
Bug Report
We used to use the
ChildOf
option to inject a parent context extracted from a message or an HTTP request but the option is not deprecated in favor ofStartChild
but we cannot instantiate the parent span from the parent context and we end up doing this:But that seems overkill. I can't find a different way so I'm assuming that's not the right approach but then I have no idea what the right one is.
Or a
Parent
option when starting the span would be possible ?Reproduction Code
Error Logs
No response
Go Env Output
No response
The text was updated successfully, but these errors were encountered: