-
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 Metrics] PR 2 - API #3252
Conversation
7beefd9
to
4907c5c
Compare
874625e
to
269cc45
Compare
@@ -305,7 +304,7 @@ func newSpansetFilter(e FieldExpression) *SpansetFilter { | |||
func (*SpansetFilter) __spansetExpression() {} | |||
|
|||
func (f *SpansetFilter) evaluate(input []*Spanset) ([]*Spanset, error) { | |||
f.outputBuffer = f.outputBuffer[:0] | |||
var outputBuffer []*Spanset |
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.
This change is required to make the traceql eval callback safe for concurrent use (so we can execute the query against multiple blocks in parallel). This was ok previously because: regular searches were single threaded or the query was compiled for each block and they got their own AST (and SpansetFilters). But now for metrics the AST keeps more state and it should be more efficient to reuse the same AST across all blocks. Otherwise it would have to create and squash repeatedly the same timeseries from each block to get the final results.
… on first error and cancel any remaining work
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.
Looks good to me.
What this PR does:
This is the result of a collaboration effort and requires #3227 for the underlying work of providing the data. Here we build out the API for metrics in Tempo.
Notes
This is one entry in a set of chained PRs. The full body of work has been split into separate buckets to make reviews and updates more manageable.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]