Skip to content

Commit

Permalink
Add 'loki_ingester_memory_chunks' when recovery from wal
Browse files Browse the repository at this point in the history
  • Loading branch information
taisho6339 committed Sep 10, 2021
1 parent ede12d8 commit 92ca322
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/ingester/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (r *ingesterRecoverer) Series(series *Series) error {
if err != nil {
return err
}
memoryChunks.Add(float64(len(series.Chunks)))
r.ing.metrics.recoveredChunksTotal.Add(float64(len(series.Chunks)))
r.ing.metrics.recoveredEntriesTotal.Add(float64(entriesAdded))
r.ing.replayController.Add(int64(bytesAdded))
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingester/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ func (s *stream) Push(
}
}()
}
}

if len(s.chunks) != prevNumChunks {
memoryChunks.Add(float64(len(s.chunks) - prevNumChunks))
}

if len(failedEntriesWithError) > 0 {
Expand Down Expand Up @@ -345,9 +348,6 @@ func (s *stream) Push(
return bytesAdded, httpgrpc.Errorf(statusCode, buf.String())
}

if len(s.chunks) != prevNumChunks {
memoryChunks.Add(float64(len(s.chunks) - prevNumChunks))
}
return bytesAdded, nil
}

Expand Down

0 comments on commit 92ca322

Please sign in to comment.