Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [ENHANCEMENT] Include backendwork dashboard and include additional alert [#5159](https://github.com/grafana/tempo/pull/5159) (@zalegrala)
* [ENHANCEMENT] Add alert for high error rate reported by vulture [#5206](https://github.com/grafana/tempo/pull/5206) (@ruslan-mikhailov)
* [ENHANCEMENT] Add backend scheduler and worker to the resources dashboard [#5206](https://github.com/grafana/tempo/pull/5241) (@javiermolinar)
* [ENHANCEMENT] TraceQL metrics performance increase for simple queries [#5247](https://github.com/grafana/tempo/pull/5247) (@mdisibio)
* [ENHANCEMENT] Align traceql attribute struct for better performance [#5240](https://github.com/grafana/tempo/pull/5240) (@mdisibio)
* [BUGFIX] Add nil check to partitionAssignmentVar [#5198](https://github.com/grafana/tempo/pull/5198) (@mapno)

Expand Down
79 changes: 37 additions & 42 deletions tempodb/encoding/vparquet4/block_traceql.go
Original file line number Diff line number Diff line change
Expand Up @@ -2977,27 +2977,19 @@ func (c *instrumentationCollector) KeepGroup(res *parquetquery.IteratorResult) b
}
}

// Second pass. Update and further filter the spans
spans = res.OtherEntries[:0]
for _, e := range res.OtherEntries {
span, ok := e.Value.(*span)
if !ok {
continue
}

// Copy scope-level attributes to the span
// If the span already has an entry for this attribute it
// takes precedence (can be nil to indicate no match)
span.setInstrumentationAttrs(c.instrumentationAttrs)
spans = append(spans, e)

}
// Second pass. Update spans with instrumentation attributes.
if len(c.instrumentationAttrs) > 0 {
for _, e := range res.OtherEntries {
span, ok := e.Value.(*span)
if !ok {
continue
}

// pass up to resource collector
res.OtherEntries = spans
// Throw out batches without any remaining spans
if len(res.OtherEntries) == 0 {
return false
// Copy scope-level attributes to the span
// If the span already has an entry for this attribute it
// takes precedence (can be nil to indicate no match)
span.setInstrumentationAttrs(c.instrumentationAttrs)
}
}

res.Entries = res.Entries[:0]
Expand Down Expand Up @@ -3065,30 +3057,31 @@ func (c *batchCollector) KeepGroup(res *parquetquery.IteratorResult) bool {
}

// Second pass. Update and further filter the spans
spans = res.OtherEntries[:0]
for _, e := range res.OtherEntries {
span, ok := e.Value.(*span)
if !ok {
continue
}

// Copy resource-level attributes to the span
// If the span already has an entry for this attribute it
// takes precedence (can be nil to indicate no match)
span.setResourceAttrs(c.resAttrs)

if c.requireAtLeastOneMatchOverall {
// Skip over span if it didn't meet minimum criteria
if span.attributesMatched() == 0 {
putSpan(span)
if len(c.resAttrs) > 0 || c.requireAtLeastOneMatchOverall {
spans = res.OtherEntries[:0]
for _, e := range res.OtherEntries {
span, ok := e.Value.(*span)
if !ok {
continue
}
}

spans = append(spans, e)
// Copy resource-level attributes to the span
// If the span already has an entry for this attribute it
// takes precedence (can be nil to indicate no match)
span.setResourceAttrs(c.resAttrs)

if c.requireAtLeastOneMatchOverall {
// Skip over span if it didn't meet minimum criteria
if span.attributesMatched() == 0 {
putSpan(span)
continue
}
}

spans = append(spans, e)
}
res.OtherEntries = spans
}
res.OtherEntries = spans

// Throw out batches without any remaining spans
if len(res.OtherEntries) == 0 {
Expand Down Expand Up @@ -3163,9 +3156,11 @@ func (c *traceCollector) KeepGroup(res *parquetquery.IteratorResult) bool {
}

// loop over all spans and add the trace-level attributes
for _, s := range finalSpanset.Spans {
s := s.(*span)
s.setTraceAttrs(c.traceAttrs)
if len(c.traceAttrs) > 0 {
for _, s := range finalSpanset.Spans {
s := s.(*span)
s.setTraceAttrs(c.traceAttrs)
}
}

if numServiceStats > 0 {
Expand Down
Loading