-
Notifications
You must be signed in to change notification settings - Fork 544
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
TraceQL: Grouping #2490
TraceQL: Grouping #2490
Conversation
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
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.
Thank you for adding doc! Updates look good.
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
After much hand-wringing I decided to deprecate the current "SpanSet" field on the return in favor of "SpanSets". For now the SpanSet field is a "random" spanset from the slice. For queries that do not create multiple spansets per trace (i.e. everything but |
Signed-off-by: Joe Elliott <[email protected]>
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. Very nice solution to get spans back in order for the second pass after grouping. A few q's but just surface-level stuff.
@@ -90,34 +96,23 @@ type Spanset struct { | |||
RootServiceName string | |||
StartTimeUnixNanos uint64 | |||
DurationNanos uint64 | |||
Attributes map[string]Static | |||
Attributes []*SpansetAttribute |
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.
What is the reason for the slice over a map? Also map[string]Static
wasn't right, it probably should be map[Attribute]Static
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.
the order is meaningful and needs to be preserved b/c it's established by the query, but the map can't preserve the order.
func spansetID(ss *tempopb.SpanSet) string { | ||
id := "" | ||
|
||
for _, s := range ss.Attributes { |
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.
Initial thought is that the whole Attributes slice could uniquely define the spanset. Does it contain attributes we don't want?
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.
yeah, if the attributes are:
by(.namespace) = "prod"
by(.service.name) = "app"
avg(duration) = 1.32ms
we only want to use the first 2 to identify the spanset
// use otherEntryCallbackSpansetKey to indicate to the rebatchIterator that either | ||
// 1) this is the last span in the spanset, or 2) there are more spans in the spanset | ||
span.cbSpansetFinal = idx == len(ss.Spans)-1 | ||
span.cbSpanset = ss |
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.
Instead of a bool on the last span, we could probably rebatch them based on equal ss pointers.
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.
we could do that, but then the rebatchIterator would have to call Next() until it received a nil span to guarantee its batches were complete. Then it would be able to dump all batches. I did this to preserve the "streaming" nature of the iterators
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
What this PR does:
by()
andcoalesce()
to the language. Purposefully only documentsby()
b/c I can't think of a use case forcoalesce()
and I want to keep docs focused.TODO:
Which issue(s) this PR fixes:
Fixes #2136
Fixes #2307
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]