|
17 | 17 | from rbd import RBD |
18 | 18 |
|
19 | 19 | from typing import DefaultDict, Optional, Dict, Any, Set, cast, Tuple, Union, List, Callable, IO |
20 | | - |
21 | 20 | LabelValues = Tuple[str, ...] |
22 | 21 | Number = Union[int, float] |
23 | 22 | MetricValue = Dict[LabelValues, Number] |
@@ -94,7 +93,7 @@ def health_status_to_number(status: str) -> int: |
94 | 93 |
|
95 | 94 | OSD_STATS = ['apply_latency_ms', 'commit_latency_ms'] |
96 | 95 |
|
97 | | -POOL_METADATA = ('pool_id', 'name', 'type', 'description', 'compression_mode') |
| 96 | +POOL_METADATA = ('pool_id', 'name', 'type', 'description', 'compression_mode', 'application') |
98 | 97 |
|
99 | 98 | RGW_METADATA = ('ceph_daemon', 'hostname', 'ceph_version', 'instance_id') |
100 | 99 |
|
@@ -127,6 +126,12 @@ class Format(enum.Enum): |
127 | 126 | yaml = 'yaml' |
128 | 127 |
|
129 | 128 |
|
| 129 | +class StorageType(enum.Enum): |
| 130 | + rbd = "Block" |
| 131 | + cephfs = "Filesystem" |
| 132 | + rgw = "Object" |
| 133 | + |
| 134 | + |
130 | 135 | class HealthCheckEvent: |
131 | 136 |
|
132 | 137 | def __init__(self, name: str, severity: Severity, first_seen: float, last_seen: float, count: int, active: bool = True): |
@@ -1267,13 +1272,20 @@ def _get_pool_info(pool: Dict[str, Any]) -> Tuple[str, str]: |
1267 | 1272 | if 'options' in pool: |
1268 | 1273 | compression_mode = pool['options'].get('compression_mode', 'none') |
1269 | 1274 |
|
| 1275 | + application_metadata = pool.get('application_metadata', {}) |
| 1276 | + application_metadata_str = ', '.join(StorageType[k].value |
| 1277 | + if k in StorageType.__members__ else str(k) |
| 1278 | + for k in application_metadata |
| 1279 | + ) |
1270 | 1280 | self.metrics['pool_metadata'].set( |
1271 | 1281 | 1, ( |
1272 | 1282 | pool['pool'], |
1273 | 1283 | pool['pool_name'], |
1274 | 1284 | pool_type, |
1275 | 1285 | pool_description, |
1276 | | - compression_mode) |
| 1286 | + compression_mode, |
| 1287 | + application_metadata_str, |
| 1288 | + ), |
1277 | 1289 | ) |
1278 | 1290 |
|
1279 | 1291 | # Populate other servers metadata |
|
0 commit comments