Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c23046d
Experiment with performance of span-only fetch
mdisibio Oct 17, 2025
1e58b70
Microoptimizations to remove unnecessary function calls from hot path
mdisibio Oct 17, 2025
5a168bb
passing first round of tests
mdisibio Oct 22, 2025
6b1f812
In progress
mdisibio Oct 22, 2025
1dab655
Mostly working on tests and benchmarks, just a few more mismatches
mdisibio Oct 29, 2025
3e27444
Support for second pass callback. Fix a few remaining accuracy issues
mdisibio Oct 30, 2025
b01d077
Support sampling
mdisibio Oct 30, 2025
fc59618
Resolve all interface issues in other modules so Tempo is fully runna…
mdisibio Oct 31, 2025
a89fd84
New fetch layer passing select all, tweaks for exact compatibility. d…
mdisibio Nov 20, 2025
8a14818
Performance tweaks, completely adopt new-style collector interface
mdisibio Nov 20, 2025
fb48d78
Cleanup fetcher interfaces, denoise diff from main
mdisibio Nov 21, 2025
bac3366
Random stuff
mdisibio Nov 21, 2025
1cb9106
Clean/perf
mdisibio Nov 21, 2025
091ffd7
Break out iter0 hotpath again for best performance, cleanup
mdisibio Nov 24, 2025
4b58289
Merge branch 'main' into fetch-spanonly
mdisibio Jan 29, 2026
f078fed
Performance improvement: instead of remembering when an optional ite…
mdisibio Feb 2, 2026
7a009ba
Elminate unnecessary allocations in SpansetFilter.Evaluate using a co…
mdisibio Feb 2, 2026
8393ec4
cleanup
mdisibio Feb 2, 2026
f130771
cleanup
mdisibio Feb 2, 2026
4140b9a
Reuse test cases across new and old fetches
mdisibio Feb 5, 2026
fd5176b
lint
mdisibio Feb 5, 2026
0cb09e4
lint
mdisibio Feb 5, 2026
d85feb7
Merge branch 'main' into fetch-spanonly
mdisibio Feb 6, 2026
cd4b3ee
Fix to not check trace timestamp in second pass, fix string output of…
mdisibio Feb 6, 2026
8ffcdbc
Readd locking in DoSpansOnly, but with batching to mitigate overhead
mdisibio Feb 11, 2026
e90b122
Merge branch 'main' into fetch-spanonly
mdisibio Feb 19, 2026
44a3cab
update new fetch layer for new operators, not all tests passing yet
mdisibio Feb 19, 2026
938ad93
Fix implementation of NilSyncIterator.SeekTo, finish and repair vp5 t…
mdisibio Feb 19, 2026
51608cc
Fix mutex deadlock and run tempodb-level tests against the new fetch …
mdisibio Feb 23, 2026
dd23082
review feedback
mdisibio Feb 23, 2026
e7ac767
review feedback
mdisibio Feb 23, 2026
2421260
review feedback
mdisibio Feb 23, 2026
56511cd
Update to use virtual row number iterator
mdisibio Feb 24, 2026
ed414bb
Fix off-by-one error in spanset copy-on-write
mdisibio Feb 24, 2026
b64094b
Comments/cleanup
mdisibio Feb 24, 2026
8bc57af
Comments/cleanup
mdisibio Feb 24, 2026
ae3dcf7
Merge branch 'main' into fetch-spanonly
mdisibio Feb 24, 2026
2f331b9
Lint, fix test
mdisibio Feb 24, 2026
06e38e0
Implement new fetch layer for vp5 wal blocks
mdisibio Feb 25, 2026
2c84f9a
cleanup
mdisibio Feb 25, 2026
c9d14b5
changelog
mdisibio Feb 26, 2026
51082c4
Merge branch 'main' into fetch-spanonly
mdisibio Mar 11, 2026
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 @@ -24,6 +24,7 @@
Adds `max_cardinality_per_label` per per-tenant override and new metrics to estimate per label cardinality demand estimate.
* [ENHANCEMENT] Add new alerts and runbooks entries [#6276](https://github.com/grafana/tempo/pull/6276) (@javiermolinar)
* [ENHANCEMENT] Double the maximum number of dedicated string columns in vParquet5 and update tempo-cli to determine the optimum number for the data [#6282](https://github.com/grafana/tempo/pull/6282) (@mdisibio)
* [ENHANCEMENT] TraceQL metrics - experimental faster read path for most metrics queries, accessible behind the query hint `new=true` [#6359](https://github.com/grafana/tempo/pull/6359) (@mdisibio)
* [ENHANCEMENT] Improve attribute truncating observability [#6400](https://github.com/grafana/tempo/pull/6400) (@javiermolinar)
* [ENHANCEMENT] Log truncated oversized attributes [#6467](https://github.com/grafana/tempo/pull/6467) (@carles-grafana)
* [ENHANCEMENT] Remove live-store partition owner from ring on shutdown to prevent stale owner entries [#6409](https://github.com/grafana/tempo/pull/6409) (@oleg-kozlyuk-grafana)
Expand Down
4 changes: 4 additions & 0 deletions modules/frontend/search_sharder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func (m *mockReader) Fetch(context.Context, *backend.BlockMeta, traceql.FetchSpa
return traceql.FetchSpansResponse{}, nil
}

func (m *mockReader) FetchSpans(context.Context, *backend.BlockMeta, traceql.FetchSpansRequest, common.SearchOptions) (traceql.FetchSpansOnlyResponse, error) {
return traceql.FetchSpansOnlyResponse{}, nil
}

func (m *mockReader) FetchTagNames(context.Context, *backend.BlockMeta, traceql.FetchTagsRequest, traceql.FetchTagsCallback, common.MetricsCallback, common.SearchOptions) error {
return nil
}
Expand Down
35 changes: 25 additions & 10 deletions modules/livestore/instance_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,17 @@
}

if api.IsTraceQLQuery(req) {
f := traceql.NewSpansetFetcherWrapperBoth(
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return b.Fetch(ctx, req, opts)
},
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansOnlyResponse, error) {
return b.FetchSpans(ctx, req, opts)
},

Check notice on line 214 in modules/livestore/instance_search.go

View workflow job for this annotation

GitHub Actions / Coverage Annotations

Uncovered lines

Lines 212-214 are not covered by tests
)
// note: we are creating new engine for each wal block,
// and engine.ExecuteSearch is parsing the query for each block
resp, err = traceql.NewEngine().ExecuteSearch(ctx, req, traceql.NewSpansetFetcherWrapper(func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return b.Fetch(ctx, req, opts)
}), i.overrides.UnsafeQueryHints(i.tenantID))
resp, err = traceql.NewEngine().ExecuteSearch(ctx, req, f, i.overrides.UnsafeQueryHints(i.tenantID))
} else {
resp, err = b.Search(ctx, req, opts)
}
Expand Down Expand Up @@ -747,10 +753,14 @@
))
defer span.End()

fetcher := traceql.NewSpansetFetcherWrapper(func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return b.Fetch(ctx, req, common.DefaultSearchOptions())
})

fetcher := traceql.NewSpansetFetcherWrapperBoth(
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return b.Fetch(ctx, req, common.DefaultSearchOptions())
},
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansOnlyResponse, error) {
return b.FetchSpans(ctx, req, common.DefaultSearchOptions())
},

Check notice on line 762 in modules/livestore/instance_search.go

View workflow job for this annotation

GitHub Actions / Coverage Annotations

Uncovered lines

Lines 756-762 are not covered by tests
)
return eval.Do(ctx, fetcher, uint64(m.StartTime.UnixNano()), uint64(m.EndTime.UnixNano()), maxSeries)
}

Expand Down Expand Up @@ -788,9 +798,14 @@
if err != nil {
return nil, err
}
f := traceql.NewSpansetFetcherWrapper(func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return b.Fetch(ctx, req, common.DefaultSearchOptions())
})
f := traceql.NewSpansetFetcherWrapperBoth(
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return b.Fetch(ctx, req, common.DefaultSearchOptions())
},
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansOnlyResponse, error) {
return b.FetchSpans(ctx, req, common.DefaultSearchOptions())
},

Check notice on line 807 in modules/livestore/instance_search.go

View workflow job for this annotation

GitHub Actions / Coverage Annotations

Uncovered lines

Lines 805-807 are not covered by tests
)
err = eval.Do(ctx, f, uint64(m.StartTime.UnixNano()), uint64(m.EndTime.UnixNano()), int(req.MaxSeries))
if err != nil {
return nil, err
Expand Down
11 changes: 8 additions & 3 deletions modules/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,14 @@
opts.MaxBytes = q.limits.MaxBytesPerTrace(tenantID)

if api.IsTraceQLQuery(req.SearchReq) {
fetcher := traceql.NewSpansetFetcherWrapper(func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return q.store.Fetch(ctx, meta, req, opts)
})
fetcher := traceql.NewSpansetFetcherWrapperBoth(
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return q.store.Fetch(ctx, meta, req, opts)
},
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansOnlyResponse, error) {
return q.store.FetchSpans(ctx, meta, req, opts)
},

Check notice on line 653 in modules/querier/querier.go

View workflow job for this annotation

GitHub Actions / Coverage Annotations

Uncovered lines

Lines 647-653 are not covered by tests
)

return q.engine.ExecuteSearch(ctx, req.SearchReq, fetcher, q.limits.UnsafeQueryHints(tenantID))
}
Expand Down
12 changes: 9 additions & 3 deletions modules/querier/querier_query_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@
return nil, err
}

f := traceql.NewSpansetFetcherWrapper(func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return q.store.Fetch(ctx, meta, req, opts)
})
f := traceql.NewSpansetFetcherWrapperBoth(
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
return q.store.Fetch(ctx, meta, req, opts)
},
func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansOnlyResponse, error) {
return q.store.FetchSpans(ctx, meta, req, opts)
},

Check notice on line 107 in modules/querier/querier_query_range.go

View workflow job for this annotation

GitHub Actions / Coverage Annotations

Uncovered lines

Lines 101-107 are not covered by tests
)

err = eval.Do(ctx, f, uint64(meta.StartTime.UnixNano()), uint64(meta.EndTime.UnixNano()), int(req.MaxSeries))
if err != nil {
return nil, err
Expand Down
Loading
Loading