Skip to content

Commit

Permalink
ingest: actually export estimated bytes per record (#10155)
Browse files Browse the repository at this point in the history
This atomic is used to export `cortex_ingest_storage_reader_estimated_bytes_per_record`

https://github.com/grafana/mimir/blob/36da907adaf09db95f18c4427760bc6b9f2457b6/pkg/storage/ingest/reader.go#L1112

But until now it was never mutated. This was a bug.

Signed-off-by: Dimitar Dimitrov <[email protected]>
  • Loading branch information
dimitarvdimitrov authored Dec 6, 2024
1 parent 31d91bc commit a26eee3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/storage/ingest/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ func (r *concurrentFetchers) start(ctx context.Context, startOffset int64, concu
// When there isn't a fetch in flight the HWM will never be updated, we will dispatch the next fetchWant even if that means it's above the HWM.
dispatchNextWant = wants
}

// Periodically update our estimation, so it's exported as a metric.
r.estimatedBytesPerRecord.Store(int64(nextFetch.estimatedBytesPerRecord))

select {
case <-r.done:
return
Expand Down

0 comments on commit a26eee3

Please sign in to comment.