mgr/telemetry: add pool flags

Pool flags can help us learn how certain features are being used, for
example, the "crimson" flag implies a crimson cluster.

We add a basic_pool_flags collection to the "basic" channel for this
purpose.

Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
This commit is contained in:
Yaarit Hatuka 2024-01-05 17:44:30 +00:00
parent 2cd80ed6c2
commit 937aa7ec21
3 changed files with 39 additions and 0 deletions

View File

@ -146,6 +146,7 @@ First release candidate
- [ ] src/ceph_release: change type to `rc`
- [ ] opt-in to all telemetry channels, generate telemetry reports, and verify no sensitive details (like pools names) are collected
- [ ] check if new pool flags exist in pg_pool_t (osd/osd_types.h), and add them to telemetry's basic_pool_flags collection, in case they are not sensitive
First stable release

View File

@ -186,6 +186,7 @@ List all collections with::
NAME STATUS DESC
basic_base NOT REPORTING: NOT OPTED-IN Basic information about the cluster (capacity, number and type of daemons, version, etc.)
basic_mds_metadata NOT REPORTING: NOT OPTED-IN MDS metadata
basic_pool_flags NOT REPORTING: NOT OPTED-IN Per-pool flags
basic_pool_options_bluestore NOT REPORTING: NOT OPTED-IN Per-pool bluestore config options
basic_pool_usage NOT REPORTING: NOT OPTED-IN Default pool application and usage statistics
basic_rook_v01 NOT REPORTING: NOT OPTED-IN Basic Rook deployment data

View File

@ -71,6 +71,7 @@ class Collection(str, enum.Enum):
basic_rook_v01 = 'basic_rook_v01'
perf_memory_metrics = 'perf_memory_metrics'
basic_pool_options_bluestore = 'basic_pool_options_bluestore'
basic_pool_flags = 'basic_pool_flags'
MODULE_COLLECTION : List[Dict] = [
{
@ -139,6 +140,12 @@ MODULE_COLLECTION : List[Dict] = [
"channel": "basic",
"nag": False
},
{
"name": Collection.basic_pool_flags,
"description": "Per-pool flags",
"channel": "basic",
"nag": False
},
]
ROOK_KEYS_BY_COLLECTION : List[Tuple[str, Collection]] = [
@ -1109,7 +1116,37 @@ class Module(MgrModule):
for option in bluestore_options:
if option in pool['options']:
pool_data['options'][option] = pool['options'][option]
# basic_pool_flags collection
if self.is_enabled_collection(Collection.basic_pool_flags):
if 'flags_names' in pool and pool['flags_names'] is not None:
# flags are defined in pg_pool_t (src/osd/osd_types.h)
flags_to_report = [
'hashpspool',
'full',
'ec_overwrites',
'incomplete_clones',
'nodelete',
'nopgchange',
'nosizechange',
'write_fadvise_dontneed',
'noscrub',
'nodeep-scrub',
'full_quota',
'nearfull',
'backfillfull',
'selfmanaged_snaps',
'pool_snaps',
'creating',
'eio',
'bulk',
'crimson',
]
pool_data['flags_names'] = [flag for flag in pool['flags_names'].split(',') if flag in flags_to_report]
cast(List[Dict[str, Any]], report['pools']).append(pool_data)
if 'rbd' in pool['application_metadata']:
rbd_num_pools += 1
ioctx = self.rados.open_ioctx(pool['pool_name'])