From: Avan Thakkar Date: Thu, 24 Jul 2025 13:25:10 +0000 (+0530) Subject: mgr/prometheus: add share name as label to SMB_METADATA metric X-Git-Tag: testing/wip-vshankar-testing-20250805.100115-debug~9^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fcce415a351c12826bc94faeae02c9000975a245;p=ceph-ci.git mgr/prometheus: add share name as label to SMB_METADATA metric Fixes: https://tracker.ceph.com/issues/72068 Signed-off-by: Avan Thakkar --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 1b8568dceae..3c204d7c599 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -106,7 +106,7 @@ DISK_OCCUPATION = ('ceph_daemon', 'device', 'db_device', NUM_OBJECTS = ['degraded', 'misplaced', 'unfound'] SMB_METADATA = ('smb_version', 'volume', - 'subvolume_group', 'subvolume', 'netbiosname') + 'subvolume_group', 'subvolume', 'netbiosname', 'share') alert_metric = namedtuple('alert_metric', 'name description') HEALTH_CHECKS = [ @@ -1752,6 +1752,7 @@ class Module(MgrModule, OrchestratorClientMixin): self.log.debug("Skipping share with missing cluster_id") continue + share_id = resource.get('share_id', '') cephfs = resource.get('cephfs', {}) cephfs_volume = cephfs.get('volume', '') cephfs_subvolumegroup = cephfs.get('subvolumegroup', '_nogroup') @@ -1761,7 +1762,8 @@ class Module(MgrModule, OrchestratorClientMixin): cephfs_volume, cephfs_subvolumegroup, cephfs_subvolume, - cluster_id + cluster_id, + share_id )) except json.JSONDecodeError: self.log.error("Failed to decode SMB module output")