]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: add rgw metadata
authorAbhishek Lekshmanan <abhishek@suse.com>
Wed, 30 Oct 2019 20:34:43 +0000 (15:34 -0500)
committerSage Weil <sage@redhat.com>
Wed, 6 Nov 2019 12:41:50 +0000 (06:41 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit f62c6e8cba2e894f84ddabdea6db4ce56e02ea63)

PendingReleaseNotes
src/pybind/mgr/telemetry/module.py

index 324636dbc014b846a7ca155ab36bd09ed85320c6..dac84744fd421d6251c92ce09d7343e9427da489 100644 (file)
@@ -29,7 +29,7 @@
 ------
 
 * The telemetry module now has a 'device' channel, enabled by default, that
-  will report anonymized hard disk and SSD health metrics to telemetry.ceph.com
+  will report anonymized hard disk and SSD hea lth metrics to telemetry.ceph.com
   in order to build and improve device failure prediction algorithms.  Because
   the content of telemetry reports has changed, you will need to either re-opt-in
   with::
@@ -68,6 +68,7 @@
     - how many hosts are in the cluster, and how many hosts have each type of daemon
     - whether a separate OSD cluster network is being used
     - how many RBD pools and images are in the cluster, and how many pools have RBD mirroring enabled
+    - how many RGW daemons, zones, and zonegroups are present; which RGW frontends are in use
 
   If you had telemetry enabled, you will need to re-opt-in with::
 
index 39f3a10eb7de9a3e5b04287982450a90db829cf7..b31582777724d562f5973b171fc62819e7771b50 100644 (file)
@@ -56,6 +56,7 @@ REVISION = 3
 #   - added host count, and counts for hosts with each of (mon, osd, mds, mgr)
 #   - whether an OSD cluster network is in use
 #   - rbd pool and image count, and rbd mirror mode (pool-level)
+#   - rgw daemons, zones, zonegroups; which rgw frontends
 
 class Module(MgrModule):
     config = dict()
@@ -574,6 +575,36 @@ class Module(MgrModule):
             report['services'] = defaultdict(int)
             for key, value in service_map['services'].items():
                 report['services'][key] += 1
+                if key == 'rgw':
+                    report['rgw'] = {
+                        'count': 0,
+                    }
+                    zones = set()
+                    realms = set()
+                    zonegroups = set()
+                    frontends = set()
+                    d = value.get('daemons', dict())
+
+                    for k,v in d.items():
+                        if k == 'summary' and v:
+                            report['rgw'][k] = v
+                        elif isinstance(v, dict) and 'metadata' in v:
+                            report['rgw']['count'] += 1
+                            zones.add(v['metadata']['zone_id'])
+                            zonegroups.add(v['metadata']['zonegroup_id'])
+                            frontends.add(v['metadata']['frontend_type#0'])
+
+                            # we could actually iterate over all the keys of
+                            # the dict and check for how many frontends there
+                            # are, but it is unlikely that one would be running
+                            # more than 2 supported ones
+                            f2 = v['metadata'].get('frontend_type#1', None)
+                            if f2:
+                                frontends.add(f2)
+
+                    report['rgw']['zones'] = len(zones)
+                    report['rgw']['zonegroups'] = len(zonegroups)
+                    report['rgw']['frontends'] = list(frontends)  # sets aren't json-serializable
 
             try:
                 report['balancer'] = self.remote('balancer', 'gather_telemetry')