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: v20.1.1~16^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11b37a9353a9bfd0e4b0ba67dbfd8511a2792184;p=ceph.git mgr/prometheus: add share name as label to SMB_METADATA metric Fixes: https://tracker.ceph.com/issues/72068 Signed-off-by: Avan Thakkar (cherry picked from commit fcce415a351c12826bc94faeae02c9000975a245) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 4a6d70678529..a6df918078b1 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -113,7 +113,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 = [ @@ -1800,6 +1800,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') @@ -1809,7 +1810,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")