]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: add share name as label to SMB_METADATA metric 64671/head
authorAvan Thakkar <athakkar@redhat.com>
Thu, 24 Jul 2025 13:25:10 +0000 (18:55 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Wed, 30 Jul 2025 12:04:26 +0000 (17:34 +0530)
Fixes: https://tracker.ceph.com/issues/72068
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
src/pybind/mgr/prometheus/module.py

index 1b8568dceae3a1761d0b59a9560f9a80596ed9c7..3c204d7c59983c06ea0424145680c18646de9fac 100644 (file)
@@ -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")