MCPcopy
hub / github.com/grafana/tempo / FetchSpans

Method FetchSpans

tempodb/encoding/vparquet5/block_traceql_fetch.go:17–30  ·  view source on GitHub ↗
(ctx context.Context, req traceql.FetchSpansRequest, opts common.SearchOptions)

Source from the content-addressed store, hash-verified

15)
16
17func (b *backendBlock) FetchSpans(ctx context.Context, req traceql.FetchSpansRequest, opts common.SearchOptions) (traceql.FetchSpansOnlyResponse, error) {
18 pf, rr, err := b.openForSearch(ctx, opts)
19 if err != nil {
20 return traceql.FetchSpansOnlyResponse{}, err
21 }
22 iter, err := fetchSpans(ctx, req, pf, rowGroupsFromFile(pf, opts), b.meta.DedicatedColumns)
23 if err != nil {
24 return traceql.FetchSpansOnlyResponse{}, err
25 }
26 return traceql.FetchSpansOnlyResponse{
27 Results: iter,
28 Bytes: func() uint64 { return rr.BytesRead() },
29 }, nil
30}
31
32// fetchSpans is the core logic for span-only fetch, like fetch is for Fetch. Callers open the parquet file and pass row groups.
33func fetchSpans(ctx context.Context, req traceql.FetchSpansRequest, pf *parquet.File, rowGroups []parquet.RowGroup, dc backend.DedicatedColumns) (*spanOnlyIterator, error) {

Callers

nothing calls this directly

Calls 4

openForSearchMethod · 0.95
fetchSpansFunction · 0.85
rowGroupsFromFileFunction · 0.70
BytesReadMethod · 0.45

Tested by

no test coverage detected