1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-02-01 13:07:51 +02:00

Fix parent span ID formatting (#103)

It was printing an ID of the created span instead. Also drop the if
clause checking if span has a parent span ID - we know at this point
that the condition is always true.
This commit is contained in:
Krzesimir Nowak 2019-08-23 07:18:31 +02:00 committed by rghetia
parent 3ca747f4e8
commit fafb3daf1e

View File

@ -54,9 +54,7 @@ func AppendEvent(buf *strings.Builder, data reader.Event) {
buf.WriteString(", a root span")
} else {
buf.WriteString(" <")
if data.Parent.HasSpanID() {
f(false)(parentSpanIDKey.String(data.SpanContext.SpanIDString()))
}
f(false)(parentSpanIDKey.String(data.Parent.SpanIDString()))
if data.ParentAttributes != nil {
data.ParentAttributes.Foreach(f(false))
}