]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: include any config options that are customized
authorSage Weil <sage@redhat.com>
Thu, 25 Jul 2019 21:22:55 +0000 (16:22 -0500)
committerSage Weil <sage@redhat.com>
Fri, 26 Jul 2019 13:17:58 +0000 (08:17 -0500)
This does not reveal the value of the options, only which options have
been customized.

Signed-off-by: Sage Weil <sage@redhat.com>
doc/mgr/telemetry.rst
src/pybind/mgr/telemetry/module.py

index 34b50ccc3fb91c557254e0c56ca54a2b6d69c1c4..7c4f8668bb7df13ec02fb0531a9d831d3f0bac8e 100644 (file)
@@ -21,6 +21,8 @@ the per-channel setting has no effect.)
     - number of monitors, managers, OSDs, MDSs, radosgws, or other daemons
     - software version currently being used
     - number and types of RADOS pools and CephFS file systems
+    - names of configuration options that have been changed from their
+      default (but *not* their values)
 
 * **crash** (default: on): Information about daemon crashes, including
 
index eace93ee4547667372c173ff424dae600d80c8c2..1b4154f13d70f82424c18557a8fdcec23eb011f6 100644 (file)
@@ -78,7 +78,7 @@ class Module(MgrModule):
             'name': 'channel_basic',
             'type': 'bool',
             'default': True,
-            'description': 'Share basic cluster information (size, version)',
+            'desc': 'Share basic cluster information (size, version)',
         },
         {
             'name': 'channel_ident',
@@ -192,6 +192,26 @@ class Module(MgrModule):
 
         return metadata
 
+    def gather_configs(self):
+        configs = set()
+        r, outb, outs = self.mon_command({
+            'prefix': 'config dump',
+            'format': 'json'
+        });
+        if r != 0:
+            return {}
+        try:
+            dump = json.loads(outb)
+        except json.decoder.JSONDecodeError:
+            return {}
+        for opt in dump:
+            name = opt.get('name')
+            if name:
+                configs.add(name)
+        return {
+            'non_default_options': [ sorted(list(configs)) ]
+        }
+
     def gather_crashinfo(self):
         crashlist = list()
         errno, crashids, err = self.remote('crash', 'ls')
@@ -255,6 +275,8 @@ class Module(MgrModule):
                 'features': mon_map['features']
             }
 
+            report['config'] = self.gather_configs()
+
             num_pg = 0
             report['pools'] = list()
             for pool in osd_map['pools']: