[TraceQL] Autocomplete for events and links#3846
Conversation
|
One caveat is because links and events are on the same definition level, they cannot be used to filter each other out effectively. I prefer to get the main functionality out first and create a new ticket to add this ability. |
| tagsV2Resp, err := apiClient.SearchTagsV2() | ||
| require.NoError(t, err) | ||
| require.Equal(t, 3, len(tagsV2Resp.GetScopes())) | ||
| fmt.Println(tagsV2Resp.Scopes) |
There was a problem hiding this comment.
Was this print statement for debugging or is it meant to stay?
| "github.com/grafana/tempo/pkg/model/trace" | ||
| "github.com/grafana/tempo/pkg/tempopb" | ||
| v1 "github.com/grafana/tempo/pkg/tempopb/common/v1" | ||
| v11 "github.com/grafana/tempo/pkg/tempopb/trace/v1" |
There was a problem hiding this comment.
nitpick we often use 'trace_v1', 'resource_v1` as import aliases
| v11 "github.com/grafana/tempo/pkg/tempopb/trace/v1" | |
| trace_v1 "github.com/grafana/tempo/pkg/tempopb/trace/v1" |
There was a problem hiding this comment.
ahhh I see, it's v11 in the pb.go files
| // if len(iters) == 0 && primaryIter == nil { | ||
| // return attrIter, nil | ||
| // } |
There was a problem hiding this comment.
Is this meant to be commented out? Just asking because the equivalent condition in createDistinctLinkIterator is not commented out (see L236)
I think it's a good idea to the the main functionality out and handle edge cases in another issue |
|
Tested it locally and it works as expected. Just left some minor comments |
mdisibio
left a comment
There was a problem hiding this comment.
Events tested locally and working well. I don't have a good testbed for links, but lgtm.
|
Will we need docs for this? |
What this PR does:
Add autocomplete support for events and links. Return empty responses for IDs in autocomplete.
Also returns event:name, link:spanID, and link:traceID to search results to be displayed on the UI
Grafana UI is not updated yet but API works as expected



event:name, link:spanID, and link:traceID


Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]