]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: add stretch_mode information
authorNaveen Naidu <naveennaidu479@gmail.com>
Sun, 3 Nov 2024 06:02:05 +0000 (11:32 +0530)
committerNaveen Naidu <naveennaidu479@gmail.com>
Mon, 27 Jan 2025 13:18:56 +0000 (18:48 +0530)
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 <naveen.naidu@ibm.com>
doc/mgr/telemetry.rst
src/pybind/mgr/telemetry/module.py

index 2d09bb9f3577903f03d65e0db304364cfb415d33..be82f1b2c3f7c7f1107e4e950c7489e96408739e 100644 (file)
@@ -190,6 +190,7 @@ List all collections with::
   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 clusters 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
index e4e238a88f285d5e03ad190ce2e30461077cd27a..ce05b1353b41b8850a6fece03ae8927eac603b2d 100644 (file)
@@ -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()