From d1de0c048d69ad5ffd75353e39b4e05037b51e8e Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Thu, 14 Mar 2024 10:19:43 +0900 Subject: [PATCH] Moving WAL memory usage into in flight data so we can get a break down per label. --- quickwit/quickwit-common/src/metrics.rs | 18 ++++++++++-------- .../quickwit-ingest/src/ingest_v2/metrics.rs | 11 ++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/quickwit/quickwit-common/src/metrics.rs b/quickwit/quickwit-common/src/metrics.rs index 97664f70d0a..4e256dd1e6f 100644 --- a/quickwit/quickwit-common/src/metrics.rs +++ b/quickwit/quickwit-common/src/metrics.rs @@ -252,12 +252,13 @@ impl Default for MemoryMetrics { #[derive(Clone)] pub struct InFlightDataGauges { - pub doc_processor_mailbox: IntGauge, - pub index_writer: IntGauge, - pub indexer_mailbox: IntGauge, - pub ingest_router: IntGauge, pub rest_server: IntGauge, + pub ingest_router: IntGauge, + pub wal: IntGauge, pub sources: InFlightDataSourceGauges, + pub doc_processor_mailbox: IntGauge, + pub indexer_mailbox: IntGauge, + pub index_writer: IntGauge, } impl Default for InFlightDataGauges { @@ -270,12 +271,13 @@ impl Default for InFlightDataGauges { ["component"], ); Self { - doc_processor_mailbox: in_flight_gauge_vec.with_label_values(["doc_processor_mailbox"]), - index_writer: in_flight_gauge_vec.with_label_values(["index_writer"]), - indexer_mailbox: in_flight_gauge_vec.with_label_values(["indexer_mailbox"]), - ingest_router: in_flight_gauge_vec.with_label_values(["ingest_router"]), rest_server: in_flight_gauge_vec.with_label_values(["rest_server"]), + ingest_router: in_flight_gauge_vec.with_label_values(["ingest_router"]), + wal: in_flight_gauge_vec.with_label_values(["wal"]), sources: InFlightDataSourceGauges::new(&in_flight_gauge_vec), + doc_processor_mailbox: in_flight_gauge_vec.with_label_values(["doc_processor_mailbox"]), + indexer_mailbox: in_flight_gauge_vec.with_label_values(["indexer_mailbox"]), + index_writer: in_flight_gauge_vec.with_label_values(["index_writer"]), } } } diff --git a/quickwit/quickwit-ingest/src/ingest_v2/metrics.rs b/quickwit/quickwit-ingest/src/ingest_v2/metrics.rs index 8f84c1acc03..b45ddce154e 100644 --- a/quickwit/quickwit-ingest/src/ingest_v2/metrics.rs +++ b/quickwit/quickwit-ingest/src/ingest_v2/metrics.rs @@ -31,7 +31,6 @@ pub(super) struct IngestV2Metrics { pub wal_acquire_lock_requests_in_flight: IntGaugeVec<2>, pub wal_acquire_lock_request_duration_secs: HistogramVec<2>, pub wal_disk_used_bytes: IntGauge, - pub wal_memory_allocated_bytes: IntGauge, pub wal_memory_used_bytes: IntGauge, } @@ -77,12 +76,6 @@ impl Default for IngestV2Metrics { "ingest", &[], ), - wal_memory_allocated_bytes: new_gauge( - "wal_memory_allocated_bytes", - "WAL memory allocated in bytes.", - "ingest", - &[], - ), wal_memory_used_bytes: new_gauge( "wal_memory_used_bytes", "WAL memory used in bytes.", @@ -97,8 +90,8 @@ pub(super) fn report_wal_usage(wal_usage: ResourceUsage) { INGEST_V2_METRICS .wal_disk_used_bytes .set(wal_usage.disk_used_bytes as i64); - INGEST_V2_METRICS - .wal_memory_allocated_bytes + quickwit_common::metrics::MEMORY_METRICS.in_flight_data + .wal .set(wal_usage.memory_allocated_bytes as i64); INGEST_V2_METRICS .wal_memory_used_bytes