From: Abhishek Lekshmanan Date: Wed, 30 Oct 2019 20:34:43 +0000 (-0500) Subject: mgr/telemetry: add rgw metadata X-Git-Tag: v12.2.13~15^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=73801b46152e51c952547e83181a9f3d7cf8b428;p=ceph.git mgr/telemetry: add rgw metadata Signed-off-by: Sage Weil (cherry picked from commit f62c6e8cba2e894f84ddabdea6db4ce56e02ea63) Conflicts: PendingReleaseNotes Dropped to prevent conflicts in the future src/pybind/mgr/telemetry/module.py Context issues due to missing patches --- diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index e5ee3514ea919..ef680952d8363 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -50,6 +50,7 @@ REVISION = 2 # - added CephFS metadata (how many MDSs, fs features, how many data pools, # how much metadata is cached) # - added more pool metadata (rep vs ec, cache tiering mode, ec profile) +# - rgw daemons, zones, zonegroups; which rgw frontends class Module(MgrModule): config = dict() @@ -424,6 +425,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 return report