]> 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, 30 Oct 2019 21:56:38 +0000 (16:56 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes
src/pybind/mgr/telemetry/module.py

index 98ea6464843d21b6a0cd6f237e76bcb23a46232c..de3dfa6e472de09a244ee18a5d84907ae951e6de 100644 (file)
   clusters.
 
 * 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::
     - 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 911a2077dd996c13ca6dfad2d53bad436491a157..c7cc5738d75bbfffe8963cda6ad275914ede8c9d 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()
@@ -561,6 +562,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')