Skip to content

Commit 24dcb42

Browse files
authored
Merge pull request ceph#55067 from yaarith/telemetry-pool-flags
mgr/telemetry: add pool flags
2 parents d400b21 + 937aa7e commit 24dcb42

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

doc/dev/release-checklists.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ First release candidate
152152

153153
- [ ] src/ceph_release: change type to `rc`
154154
- [ ] opt-in to all telemetry channels, generate telemetry reports, and verify no sensitive details (like pools names) are collected
155+
- [ ] 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
155156

156157

157158
First stable release

doc/mgr/telemetry.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ List all collections with::
186186
NAME STATUS DESC
187187
basic_base NOT REPORTING: NOT OPTED-IN Basic information about the cluster (capacity, number and type of daemons, version, etc.)
188188
basic_mds_metadata NOT REPORTING: NOT OPTED-IN MDS metadata
189+
basic_pool_flags NOT REPORTING: NOT OPTED-IN Per-pool flags
189190
basic_pool_options_bluestore NOT REPORTING: NOT OPTED-IN Per-pool bluestore config options
190191
basic_pool_usage NOT REPORTING: NOT OPTED-IN Default pool application and usage statistics
191192
basic_rook_v01 NOT REPORTING: NOT OPTED-IN Basic Rook deployment data

src/pybind/mgr/telemetry/module.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class Collection(str, enum.Enum):
7171
basic_rook_v01 = 'basic_rook_v01'
7272
perf_memory_metrics = 'perf_memory_metrics'
7373
basic_pool_options_bluestore = 'basic_pool_options_bluestore'
74+
basic_pool_flags = 'basic_pool_flags'
7475

7576
MODULE_COLLECTION : List[Dict] = [
7677
{
@@ -139,6 +140,12 @@ class Collection(str, enum.Enum):
139140
"channel": "basic",
140141
"nag": False
141142
},
143+
{
144+
"name": Collection.basic_pool_flags,
145+
"description": "Per-pool flags",
146+
"channel": "basic",
147+
"nag": False
148+
},
142149
]
143150

144151
ROOK_KEYS_BY_COLLECTION : List[Tuple[str, Collection]] = [
@@ -1109,7 +1116,37 @@ def compile_report(self, channels: Optional[List[str]] = None) -> Dict[str, Any]
11091116
for option in bluestore_options:
11101117
if option in pool['options']:
11111118
pool_data['options'][option] = pool['options'][option]
1119+
1120+
# basic_pool_flags collection
1121+
if self.is_enabled_collection(Collection.basic_pool_flags):
1122+
if 'flags_names' in pool and pool['flags_names'] is not None:
1123+
# flags are defined in pg_pool_t (src/osd/osd_types.h)
1124+
flags_to_report = [
1125+
'hashpspool',
1126+
'full',
1127+
'ec_overwrites',
1128+
'incomplete_clones',
1129+
'nodelete',
1130+
'nopgchange',
1131+
'nosizechange',
1132+
'write_fadvise_dontneed',
1133+
'noscrub',
1134+
'nodeep-scrub',
1135+
'full_quota',
1136+
'nearfull',
1137+
'backfillfull',
1138+
'selfmanaged_snaps',
1139+
'pool_snaps',
1140+
'creating',
1141+
'eio',
1142+
'bulk',
1143+
'crimson',
1144+
]
1145+
1146+
pool_data['flags_names'] = [flag for flag in pool['flags_names'].split(',') if flag in flags_to_report]
1147+
11121148
cast(List[Dict[str, Any]], report['pools']).append(pool_data)
1149+
11131150
if 'rbd' in pool['application_metadata']:
11141151
rbd_num_pools += 1
11151152
ioctx = self.rados.open_ioctx(pool['pool_name'])

0 commit comments

Comments
 (0)