-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
Excuse me, how is the parent-child relationship of traceIds generated in the node-agent? I only found the following code. Is the parentTraceId an empty string here? Thank you very much.
func (t *Trace) createSpan(name string, duration time.Duration, error bool, attrs ...attribute.KeyValue) {
if t.tracer.otel == nil {
return
}
end := time.Now()
if !shouldSample() {
return
}
start := end.Add(-duration)
_, span := t.tracer.otel.Start(nil, name, trace.WithTimestamp(start), trace.WithSpanKind(trace.SpanKindClient)) //context is nil
span.SetAttributes(attrs...)
span.SetAttributes(t.commonAttrs...)
if error {
span.SetStatus(codes.Error, "")
}
span.End(trace.WithTimestamp(end))
}
Metadata
Metadata
Assignees
Labels
No labels