From b62a22912459e76a466526d3c3266d1a3122b21f Mon Sep 17 00:00:00 2001 From: Naveen Naidu Date: Sun, 3 Nov 2024 11:32:05 +0530 Subject: [PATCH] mgr/telemetry: add stretch_mode information Stretch Mode information helps us learn how deployments are done for stretch clusters. We add a basic_stretch_cluster collection fo the "basic" channel for this purpose. Fixes: https://tracker.ceph.com/issues/67812 Signed-off-by: Naveen Naidu (cherry picked from commit 6472b6b9f94affb96be341c9d595e543d734f30b) --- doc/mgr/telemetry.rst | 1 + src/pybind/mgr/telemetry/module.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/mgr/telemetry.rst b/doc/mgr/telemetry.rst index 97c4abe9364..8a06964671a 100644 --- a/doc/mgr/telemetry.rst +++ b/doc/mgr/telemetry.rst @@ -235,6 +235,7 @@ To list all collections, run the following command: basic_pool_options_bluestore NOT REPORTING: NOT OPTED-IN Per-pool bluestore config options basic_pool_usage NOT REPORTING: NOT OPTED-IN Default pool application and usage statistics basic_rook_v01 NOT REPORTING: NOT OPTED-IN Basic Rook deployment data + basic_stretch_cluster NOT REPORTING: NOT OPTED-IN Stretch Mode information for stretch cluster deployments basic_usage_by_class NOT REPORTING: NOT OPTED-IN Default device class usage statistics crash_base NOT REPORTING: NOT OPTED-IN Information about daemon crashes (daemon type and version, backtrace, etc.) device_base NOT REPORTING: NOT OPTED-IN Information about device health metrics diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index e4e238a88f2..ce05b1353b4 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -72,6 +72,7 @@ class Collection(str, enum.Enum): perf_memory_metrics = 'perf_memory_metrics' basic_pool_options_bluestore = 'basic_pool_options_bluestore' basic_pool_flags = 'basic_pool_flags' + basic_stretch_cluster = 'basic_stretch_cluster' MODULE_COLLECTION : List[Dict] = [ { @@ -146,6 +147,12 @@ MODULE_COLLECTION : List[Dict] = [ "channel": "basic", "nag": False }, + { + "name": Collection.basic_stretch_cluster, + "description": "Stretch mode information for stretch clusters", + "channel": "basic", + "nag": False + }, ] ROOK_KEYS_BY_COLLECTION : List[Tuple[str, Collection]] = [ @@ -1318,6 +1325,17 @@ class Module(MgrModule): # Rook self.get_rook_data(report) + # Stretch Mode + if self.is_enabled_collection(Collection.basic_stretch_cluster): + stretch_mode = osd_map.get("stretch_mode", {}) + report['stretch_cluster'] = { + 'stretch_mode_enabled': stretch_mode.get("stretch_mode_enabled", {}), + 'stretch_bucket_count': stretch_mode.get("stretch_bucket_count", {}), + 'degraded_stretch_mode': stretch_mode.get("degraded_stretch_mode", {}), + 'recovering_stretch_mode': stretch_mode.get("recovering_stretch_mode", {}), + 'stretch_mode_bucket': stretch_mode.get("stretch_mode_bucket", {}), + } + if 'crash' in channels: report['crashes'] = self.gather_crashinfo() -- 2.47.3