-
Notifications
You must be signed in to change notification settings - Fork 521
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 event intrinsic event:name #3708
TraceQL event intrinsic event:name #3708
Conversation
There are two behaviors that I'm not quite sure about. It would be great to get feedback about them
|
ba63592
to
3d529e0
Compare
@@ -833,6 +834,7 @@ var intrinsicColumnLookups = map[traceql.Intrinsic]struct { | |||
traceql.IntrinsicTraceID: {intrinsicScopeTrace, traceql.TypeString, columnPathTraceID}, | |||
traceql.IntrinsicTraceStartTime: {intrinsicScopeTrace, traceql.TypeDuration, columnPathStartTimeUnixNano}, | |||
|
|||
traceql.IntrinsicEventName: {intrinsicScopeEvent, traceql.TypeNil, ""}, // Not used in vparquet3, this entry is only used to assign default scope. |
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.
Since this isn't supported in vParquet2/3, I think we need to ensure that a query using event intrinsics doesn't execute. Currently, it looks like the condition will be silently dropped while fetching, which means the query results could be incorrect: the {name=x && event:name=y}
will be executed against a vp2/3 block as {name=x}
. checkConditions could return ErrUnsupported if any event scope condition is present. Didn't see if this is caught elsewhere.
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.
Currently queries with event:name
fail in categorizeConditions()
which results in a rather cryptic error reported in the UI. I agree, it's much better to check this explicitly in checkConditions()
and wrap ErrUnsupported.
eventIters = append(eventIters, primaryIter) | ||
} | ||
|
||
return parquetquery.NewJoinIterator(4, eventIters, &eventCollector{}, parquetquery.WithPool(pqEventPool)), nil |
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.
nit: let's create a const for the definitionlevel=4
63edfbf
to
7bb6ef4
Compare
LGTM! Awesome work! Will steal this for my PR 😄 Nit: May I suggest a test in
|
Good point, thank you. I've added the test case |
What this PR does:
Add
event
scope and the intrinsicevent:name
Autocomplete is currently not working, but is also part of a separate issue.
Which issue(s) this PR fixes:
Contributes to grafana/tempo-squad#424
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]