]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: cleanup the smb share processing logs 68094/head
authorNizamudeen A <nia@redhat.com>
Sun, 29 Mar 2026 12:04:45 +0000 (17:34 +0530)
committerNizamudeen A <nia@redhat.com>
Sun, 29 Mar 2026 12:10:23 +0000 (17:40 +0530)
It logs the same output for as many share exists in the cluster.
Instead creating a debug log if we want to see the share that's being
processed and moving the generic message outside the for loop.

Currently, the logs look like this if you have lot of shares
```
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
Mar 28 04:43:11 ceph-node-00 ceph-mgr[2272]: [prometheus INFO prometheus] Processing SMB share resource
```

Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/prometheus/module.py

index 5477df02e12ad33227fc755baa0953c065dd8f31..067364688fbe96d5b253f757a6207db96b0515cd 100644 (file)
@@ -1961,15 +1961,16 @@ class Module(MgrModule, OrchestratorClientMixin):
             try:
                 smb_data = json.loads(out)
 
+                self.log.info("Processing SMB share resource")
                 for resource in smb_data.get('resources', []):
                     if resource.get('resource_type') == 'ceph.smb.share':
-                        self.log.info("Processing SMB share resource")
                         cluster_id = resource.get('cluster_id')
                         if not cluster_id:
                             self.log.debug("Skipping share with missing cluster_id")
                             continue
 
                         share_id = resource.get('share_id', '')
+                        self.log.debug(f"Processing SMB share resource: {share_id} in cluster {cluster_id}")
                         cephfs = resource.get('cephfs', {})
                         cephfs_volume = cephfs.get('volume', '')
                         cephfs_subvolumegroup = cephfs.get('subvolumegroup', '_nogroup')