-
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] Add support for searching by trace:id and span:id #3670
Conversation
@@ -999,7 +1000,7 @@ func createSpanIterator(makeIter makeIterFn, primaryIter parquetquery.Iterator, | |||
switch cond.Attribute.Intrinsic { | |||
case traceql.IntrinsicSpanID: | |||
|
|||
pred, err := createStringPredicate(cond.Op, cond.Operands) | |||
pred, err := createBytesPredicate(cond.Op, cond.Operands, true) |
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.
placeholder until #3667 is merged with the new predicates
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 new predicates will not have a bytes predicate. I would just write a new one in pkg/parquetquery/predicates.go
.
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 the string predicate actually uses bytes array, reusing the string predicate works well. Any concerns about this?
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.
nope. not if it does what we want
pkg/util/traceid.go
Outdated
@@ -9,7 +9,7 @@ import ( | |||
"unsafe" | |||
) | |||
|
|||
func HexStringToTraceID(id string) ([]byte, error) { | |||
func HexStringToID(id string, isSpan bool) ([]byte, error) { |
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 function HexStringToID()
is no longer used outside this package (and probably should no longer be used, as it has merely become a helper function). Consider making the function private and maybe move it below the functions HexStringToTraceID()
and HexStringToSpanID()
When I use an ID string that is too long when querying or
This is of course not wrong. But I'm wondering whether it would be better to just not return any matches |
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
Awesome PR!
What this PR does: Add support for searching by trace:id and span:id. One thing to note is that when comparing bytes array, Tempo will left trim "x00". This means that
[]byte{0x02} == []byte{0x00, 0x02}
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]