-
Hi, I am facing a scienario that I need calling func_B and func_C sequentially in funcA.
In each function, I create a span using However, I would like a structure like with B and C on the same level(on my backend UI). I just cannot find a way to do that. Any idea? Many thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, No. Context in go is immutable, it cannot be updated. For example:
In there, the first created span has no parent, since we create a brand new context for it. |
Beta Was this translation helpful? Give feedback.
Hi,
No. Context in go is immutable, it cannot be updated.
When you call
tracer.Start
, two arguments are returned. The first one is the new context, the second one is the new span.If your third span is created against the same context as your second one, they will both have the same parent.
For example:
In there, the first created span has no parent, since we create a brand new context for it.
The second one has A as a parent, since we use the context from that span.
The third one also has A as a parent, for the same reason.