Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Don't include ParentSpanId when zero #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmthrgd
Copy link

@tmthrgd tmthrgd commented Oct 6, 2019

The ParentSpanId field of tracepb.Span must be empty for the root span.

This causes issues when combined with opentelemetry-collector and the jaeger gRPC exporter.

The ParentSpanId field of tracepb.Span must be empty for the root span.
@@ -38,10 +38,14 @@ func ocSpanToProtoSpan(sd *trace.SpanData) *tracepb.Span {
if sd.Name != "" {
namePtr = &tracepb.TruncatableString{Value: sd.Name}
}
var parentSpanID []byte
if sd.ParentSpanID != (trace.SpanID{}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this needs to be fixed here and not in the Jaeger gRPC exporter in the collector.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field is documented as “If this is a root span, then this field must be empty.“ which it currently isn’t, so this is definitely a bug in this repo IMO. The Jaeger gRPC exporter could work around it, but it is following the documentation and this bug could easily cause problems with other systems. It is also a really trivial fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants