From c9646f086653542007dfbbc693ff778fd36b59e7 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Tue, 16 Jul 2024 18:34:14 +0900 Subject: [PATCH] Added apply_plan counter in the control plane. (#5232) --- .../quickwit-control-plane/src/indexing_scheduler/mod.rs | 1 + quickwit/quickwit-control-plane/src/metrics.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/quickwit/quickwit-control-plane/src/indexing_scheduler/mod.rs b/quickwit/quickwit-control-plane/src/indexing_scheduler/mod.rs index d89cc4bb6bd..ac8ddc7663d 100644 --- a/quickwit/quickwit-control-plane/src/indexing_scheduler/mod.rs +++ b/quickwit/quickwit-control-plane/src/indexing_scheduler/mod.rs @@ -352,6 +352,7 @@ impl IndexingScheduler { notify_on_drop: Option>, ) { debug!(new_physical_plan=?new_physical_plan, "apply physical indexing plan"); + crate::metrics::CONTROL_PLANE_METRICS.apply_total.inc(); for (node_id, indexing_tasks) in new_physical_plan.indexing_tasks_per_indexer() { // We don't want to block on a slow indexer so we apply this change asynchronously // TODO not blocking is cool, but we need to make sure there is not accumulation diff --git a/quickwit/quickwit-control-plane/src/metrics.rs b/quickwit/quickwit-control-plane/src/metrics.rs index f2976f093e5..ee1440edfb0 100644 --- a/quickwit/quickwit-control-plane/src/metrics.rs +++ b/quickwit/quickwit-control-plane/src/metrics.rs @@ -32,6 +32,7 @@ pub struct ControlPlaneMetrics { pub indexes_total: IntGauge, pub restart_total: IntCounter, pub schedule_total: IntCounter, + pub apply_total: IntCounter, pub metastore_error_aborted: IntCounter, pub metastore_error_maybe_executed: IntCounter, pub open_shards_total: IntGaugeVec<1>, @@ -73,6 +74,12 @@ impl Default for ControlPlaneMetrics { "control_plane", &[], ), + apply_total: new_counter( + "apply_total", + "Number of control plane `apply plan` operations.", + "control_plane", + &[], + ), metastore_error_aborted: new_counter( "metastore_error_aborted", "Number of aborted metastore transaction (= do not trigger a control plane \