Skip to content

Commit fcae0a3

Browse files
authored
Put trace span from QueryStream under Select (#3652)
By passing in the context created for distributorQuerier.Select. This makes traces easier to follow.
1 parent a814306 commit fcae0a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/querier/distributor_queryable.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (q *distributorQuerier) Select(_ bool, sp *storage.SelectHints, matchers ..
116116
}
117117

118118
if q.streaming {
119-
return q.streamingSelect(minT, maxT, matchers)
119+
return q.streamingSelect(ctx, minT, maxT, matchers)
120120
}
121121

122122
matrix, err := q.distributor.Query(ctx, model.Time(minT), model.Time(maxT), matchers...)
@@ -128,13 +128,13 @@ func (q *distributorQuerier) Select(_ bool, sp *storage.SelectHints, matchers ..
128128
return series.MatrixToSeriesSet(matrix)
129129
}
130130

131-
func (q *distributorQuerier) streamingSelect(minT, maxT int64, matchers []*labels.Matcher) storage.SeriesSet {
132-
userID, err := tenant.TenantID(q.ctx)
131+
func (q *distributorQuerier) streamingSelect(ctx context.Context, minT, maxT int64, matchers []*labels.Matcher) storage.SeriesSet {
132+
userID, err := tenant.TenantID(ctx)
133133
if err != nil {
134134
return storage.ErrSeriesSet(err)
135135
}
136136

137-
results, err := q.distributor.QueryStream(q.ctx, model.Time(minT), model.Time(maxT), matchers...)
137+
results, err := q.distributor.QueryStream(ctx, model.Time(minT), model.Time(maxT), matchers...)
138138
if err != nil {
139139
return storage.ErrSeriesSet(err)
140140
}

0 commit comments

Comments
 (0)