Skip to content

Commit

Permalink
Fixes ingester stats. (#3350)
Browse files Browse the repository at this point in the history
This correclty use the stats context.

Introduced by https://github.com/grafana/loki/pull/1837/files#diff-d48cc90b5e10796f4e5256f2c7f4a7009c7c6799b514d7699676f73ae1be09c3L224

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
  • Loading branch information
cyriltovena authored Feb 18, 2021
1 parent c4d3f72 commit f4f1239
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func (cfg *Config) Validate() error {
return errors.New("the use of the write ahead log (WAL) is incompatible with chunk transfers. It's suggested to use the WAL. Please try setting ingester.max-transfer-retries to 0 to disable transfers")
}
return nil

}

// Ingester builds chunks for incoming log streams.
Expand Down Expand Up @@ -219,7 +218,6 @@ func New(cfg Config, clientConfig client.Config, store ChunkStore, limits *valid
}

func (i *Ingester) starting(ctx context.Context) error {

if i.cfg.WAL.Enabled {
// Ignore retain period during wal replay.
old := i.cfg.RetainPeriod
Expand Down Expand Up @@ -447,7 +445,7 @@ func (i *Ingester) Query(req *logproto.QueryRequest, queryServer logproto.Querie

defer helpers.LogErrorWithContext(ctx, "closing iterator", heapItr.Close)

return sendBatches(queryServer.Context(), heapItr, queryServer, req.Limit)
return sendBatches(ctx, heapItr, queryServer, req.Limit)
}

// QuerySample the ingesters for series from logs matching a set of matchers.
Expand Down Expand Up @@ -486,7 +484,7 @@ func (i *Ingester) QuerySample(req *logproto.SampleQueryRequest, queryServer log

defer helpers.LogErrorWithContext(ctx, "closing iterator", heapItr.Close)

return sendSampleBatches(queryServer.Context(), heapItr, queryServer)
return sendSampleBatches(ctx, heapItr, queryServer)
}

// boltdbShipperMaxLookBack returns a max look back period only if active index type is boltdb-shipper.
Expand Down

0 comments on commit f4f1239

Please sign in to comment.