ceph telemetry collection ls
- NAME ENROLLED STATUS DEFAULT DESC
- basic_base FALSE OFF ON Basic information about the cluster (capacity, number and type of daemons, version, etc.)
- basic_mds_metadata FALSE OFF ON MDS metadata
- crash_base FALSE OFF ON Information about daemon crashes (daemon type and version, backtrace, etc.)
- device_base FALSE OFF ON Information about device health metrics
- ident_base FALSE OFF OFF User-provided identifying information about the cluster
- perf_perf FALSE OFF OFF Information about performance of the cluster
+ NAME STATUS DESC
+ basic_base REPORTING Basic information about the cluster (capacity, number and type of daemons, version, etc.)
+ basic_mds_metadata NOT REPORTING: NOT OPTED-IN MDS metadata
+ crash_base REPORTING Information about daemon crashes (daemon type and version, backtrace, etc.)
+ device_base REPORTING Information about device health metrics
+ ident_base NOT REPORTING: CHANNEL ident IS OFF User-provided identifying information about the cluster
+ perf_perf NOT REPORTING: NOT OPTED-IN, CHANNEL perf IS OFF Information about performance counters of the cluster
+
Where:
**NAME**: Collection name; prefix indicates the channel the collection belongs to.
-**ENROLLED**: Signifies the collections that were available in the module when
-the user last opted-in to telemetry. Please note: Even if a collection is
-'enrolled', its metrics will be reported only if its channel is enabled.
-The STATUS column indicates whether the collection is being reported.
-
**STATUS**: Indicates whether the collection metrics are reported; this is
determined by the status (enabled / disabled) of the channel the collection
-belongs to, along with the enrollment status of the collection.
-
-**DEFAULT**: The default status (enabled / disabled) of the channel the
-collection belongs to.
+belongs to, along with the enrollment status of the collection (whether the user
+is opted-in to this collection).
**DESC**: General description of the collection.
'''
List all collections
'''
+ col_delta = self.collection_delta()
+ msg = ''
+ if col_delta is not None and len(col_delta) > 0:
+ msg = f"New collections are available:\n" \
+ f"{sorted([c.name for c in col_delta])}\n" \
+ f"Run `ceph telemetry on` to opt-in to these collections.\n"
+
table = PrettyTable(
[
- 'NAME', 'ENROLLED', 'STATUS', 'DEFAULT', 'DESC',
+ 'NAME', 'STATUS', 'DESC',
],
border=False)
table.align['NAME'] = 'l'
- table.align['ENROLLED'] = 'l'
table.align['STATUS'] = 'l'
- table.align['DEFAULT'] = 'l'
table.align['DESC'] = 'l'
table.left_padding_width = 0
table.right_padding_width = 4
for c in MODULE_COLLECTION:
name = c['name']
- enrolled = "TRUE" if self.is_enabled_collection(name) else "FALSE"
- status = "ON" if getattr(self, f"channel_{c['channel']}") and self.is_enabled_collection(name) \
- else "OFF"
- # default value of *channel*, since we check for active channels
- # when generating reports
- for o in self.MODULE_OPTIONS:
- if o['name'] == f"channel_{c['channel']}":
- default = "ON" if o.get('default', None) else "OFF"
+ opted_in = self.is_enabled_collection(name)
+ channel_enabled = getattr(self, f"channel_{c['channel']}")
+
+ status = ''
+ if channel_enabled and opted_in:
+ status = "REPORTING"
+ else:
+ why = ''
+ delimiter = ''
+
+ if not opted_in:
+ why += "NOT OPTED-IN"
+ delimiter = ', '
+ if not channel_enabled:
+ why += f"{delimiter}CHANNEL {c['channel']} IS OFF"
+
+ status = f"NOT REPORTING: {why}"
desc = c['description']
table.add_row((
name,
- enrolled,
status,
- default,
desc,
))
- return 0, table.get_string(sortby="NAME"), ''
+ if len(msg):
+ # add a new line between message and table output
+ msg = f"{msg} \n"
+
+ return 0, f'{msg}{table.get_string(sortby="NAME")}', ''
@CLICommand('telemetry send')
def do_send(self,