-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow multiple root spans to exist in a tracetest trace #2518
Conversation
This is related to the issue #2517 |
@@ -23,23 +23,30 @@ func NewTrace(traceID string, spans []Span) Trace { | |||
spanMap[spanID] = &spanCopy | |||
} | |||
|
|||
var rootSpan *Span = nil | |||
rootSpans := make([]*Span, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to preallocate the space?
rootSpans := make([]*Span, 0) | |
rootSpans := make([]*Span, 0, len(spanMap)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's worth it because most traces have only one root span. This would allocate way too much space in most cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
allow multiple roots to exist in a tracetest test
This PR allows our traces to have multiple root spans. They will always be children of the trigger span
Checklist