]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: add share name as label to SMB_METADATA metric
authorAvan Thakkar <athakkar@redhat.com>
Thu, 24 Jul 2025 13:25:10 +0000 (18:55 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Mon, 15 Sep 2025 06:36:45 +0000 (12:06 +0530)
Fixes: https://tracker.ceph.com/issues/72068
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit fcce415a351c12826bc94faeae02c9000975a245)

src/pybind/mgr/prometheus/module.py

index 4a6d7067852996b9c29b7d9d5052b3b27ae35cf3..a6df918078b1682f523c09eec1e4c3e2d8e291d1 100644 (file)
@@ -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")