Skip to content

Commit 2bf1b61

Browse files
authored
Fix cortex_ingester_tsdb_mmap_chunks_total metric (#6134)
1 parent 342fded commit 2bf1b61

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
* [BUGFIX] Ingester: Fix issue with the minimize token generator where it was not taking in consideration the current ownerhip of an instance when generating extra tokens. #6062
4646
* [BUGFIX] Scheduler: Fix user queue in scheduler that was not thread-safe. #6077
4747
* [BUGFIX] Ingester: Include out-of-order head compaction when compacting TSDB head. #6108
48+
* [BUGFIX] Ingester: Fix `cortex_ingester_tsdb_mmap_chunks_total` metric. #6134
4849

4950
## 1.17.1 2024-05-20
5051

pkg/ingester/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ func (sm *tsdbMetrics) Collect(out chan<- prometheus.Metric) {
632632
data.SendSumOfCountersPerUserWithLabels(out, sm.tsdbOutOfOrderSamplesAppended, "prometheus_tsdb_head_out_of_order_samples_appended_total", "type")
633633
data.SendSumOfCounters(out, sm.tsdbSnapshotReplayErrorTotal, "prometheus_tsdb_snapshot_replay_error_total")
634634
data.SendSumOfHistograms(out, sm.tsdbOOOHistogram, "prometheus_tsdb_sample_ooo_delta")
635-
data.SendSumOfGauges(out, sm.tsdbMmapChunksTotal, "prometheus_tsdb_mmap_chunks_total")
635+
data.SendSumOfCounters(out, sm.tsdbMmapChunksTotal, "prometheus_tsdb_mmap_chunks_total")
636636
data.SendSumOfCounters(out, sm.checkpointDeleteFail, "prometheus_tsdb_checkpoint_deletions_failed_total")
637637
data.SendSumOfCounters(out, sm.checkpointDeleteTotal, "prometheus_tsdb_checkpoint_deletions_total")
638638
data.SendSumOfCounters(out, sm.checkpointCreationFail, "prometheus_tsdb_checkpoint_creations_failed_total")

pkg/ingester/metrics_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ func TestTSDBMetrics(t *testing.T) {
324324
# TYPE cortex_ingester_tsdb_mmap_chunk_corruptions_total counter
325325
cortex_ingester_tsdb_mmap_chunk_corruptions_total 2577406
326326
# HELP cortex_ingester_tsdb_mmap_chunks_total Total number of chunks that were memory-mapped.
327-
# TYPE cortex_ingester_tsdb_mmap_chunks_total gauge
328-
cortex_ingester_tsdb_mmap_chunks_total 0
327+
# TYPE cortex_ingester_tsdb_mmap_chunks_total counter
328+
cortex_ingester_tsdb_mmap_chunks_total 312
329329
# HELP cortex_ingester_tsdb_out_of_order_samples_total Total number of out of order samples ingestion failed attempts due to out of order being disabled.
330330
# TYPE cortex_ingester_tsdb_out_of_order_samples_total counter
331331
cortex_ingester_tsdb_out_of_order_samples_total{type="float",user="user1"} 102
@@ -576,8 +576,8 @@ func TestTSDBMetricsWithRemoval(t *testing.T) {
576576
# TYPE cortex_ingester_tsdb_mmap_chunk_corruptions_total counter
577577
cortex_ingester_tsdb_mmap_chunk_corruptions_total 2577406
578578
# HELP cortex_ingester_tsdb_mmap_chunks_total Total number of chunks that were memory-mapped.
579-
# TYPE cortex_ingester_tsdb_mmap_chunks_total gauge
580-
cortex_ingester_tsdb_mmap_chunks_total 0
579+
# TYPE cortex_ingester_tsdb_mmap_chunks_total counter
580+
cortex_ingester_tsdb_mmap_chunks_total 312
581581
# HELP cortex_ingester_tsdb_out_of_order_samples_total Total number of out of order samples ingestion failed attempts due to out of order being disabled.
582582
# TYPE cortex_ingester_tsdb_out_of_order_samples_total counter
583583
cortex_ingester_tsdb_out_of_order_samples_total{type="float",user="user1"} 102

0 commit comments

Comments
 (0)