From f62c6e8cba2e894f84ddabdea6db4ce56e02ea63 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Wed, 30 Oct 2019 15:34:43 -0500 Subject: [PATCH] mgr/telemetry: add rgw metadata Signed-off-by: Sage Weil --- PendingReleaseNotes | 3 ++- src/pybind/mgr/telemetry/module.py | 31 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 98ea6464843d2..de3dfa6e472de 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -174,7 +174,7 @@ 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:: @@ -213,6 +213,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:: diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 911a2077dd996..c7cc5738d75bb 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -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') -- 2.39.5