Skip to content

Commit

Permalink
mgr/telemetry: include any config options that are customized
Browse files Browse the repository at this point in the history
This does not reveal the value of the options, only which options have
been customized.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Jul 26, 2019
1 parent 9ecfc55 commit fce9fe8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/mgr/telemetry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 23 additions & 1 deletion src/pybind/mgr/telemetry/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -192,6 +192,26 @@ def gather_mon_metadata(self, mon_map):

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')
Expand Down Expand Up @@ -255,6 +275,8 @@ def compile_report(self, channels=[]):
'features': mon_map['features']
}

report['config'] = self.gather_configs()

num_pg = 0
report['pools'] = list()
for pool in osd_map['pools']:
Expand Down

0 comments on commit fce9fe8

Please sign in to comment.