Skip to content
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

fix(spans): corrects early-close for a few spans #12887

Merged
merged 1 commit into from
May 3, 2024
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
14 changes: 12 additions & 2 deletions pkg/indexgateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func (g *Gateway) boundedShards(
// sending multiple requests to the entire keyspace).

logger := util_log.WithContext(ctx, g.log)
sp, ctx := opentracing.StartSpanFromContext(ctx, "indexgateway.getShardsWithBlooms")
sp, ctx := opentracing.StartSpanFromContext(ctx, "indexgateway.boundedShards")
defer sp.Finish()

// 1) for all bounds, get chunk refs
Expand All @@ -431,6 +431,11 @@ func (g *Gateway) boundedShards(
for _, g := range grps {
ct += len(g)
}

sp.LogKV(
"stage", "queried local index",
"index_chunks_resolved", ct,
)
// TODO(owen-d): pool
refs := make([]*logproto.ChunkRef, 0, ct)

Expand All @@ -443,11 +448,15 @@ func (g *Gateway) boundedShards(
filtered := refs

// 2) filter via blooms if enabled
if g.bloomQuerier != nil && len(syntax.ExtractLineFilters(p.Plan().AST)) > 0 {
filters := syntax.ExtractLineFilters(p.Plan().AST)
if g.bloomQuerier != nil && len(filters) > 0 {
filtered, err = g.bloomQuerier.FilterChunkRefs(ctx, instanceID, req.From, req.Through, refs, p.Plan())
if err != nil {
return err
}
sp.LogKV(
"stage", "queried bloom gateway",
)
}

g.metrics.preFilterChunks.WithLabelValues(routeShards).Observe(float64(ct))
Expand Down Expand Up @@ -508,6 +517,7 @@ func (g *Gateway) boundedShards(
"through", req.Through.Time().String(),
"length", req.Through.Time().Sub(req.From.Time()).String(),
"end_delta", time.Since(req.Through.Time()).String(),
"filters", len(filters),
)

// 3) build shards
Expand Down
1 change: 0 additions & 1 deletion pkg/querier/queryrange/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ func (q *querySizeLimiter) guessLimitName() string {

func (q *querySizeLimiter) Do(ctx context.Context, r queryrangebase.Request) (queryrangebase.Response, error) {
log := spanlogger.FromContext(ctx)
defer log.Finish()

// Only support TSDB
schemaCfg, err := q.getSchemaCfg(r)
Expand Down
1 change: 0 additions & 1 deletion pkg/querier/queryrange/shard_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ func (r *dynamicShardResolver) ShardingRanges(expr syntax.Expr, targetBytesPerSh
error,
) {
log := spanlogger.FromContext(r.ctx)
defer log.Finish()

adjustedFrom := r.from

Expand Down
Loading