]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/mgr/mgr_module.py: Set instance_id label for rgw
authorBenoît Knecht <bknecht@protonmail.ch>
Fri, 12 Nov 2021 14:07:35 +0000 (15:07 +0100)
committerBenoît Knecht <bknecht@protonmail.ch>
Tue, 11 Jan 2022 11:48:55 +0000 (12:48 +0100)
Now that the RadosGW returns its instance ID instead of its daemon name,
replace the `ceph_daemon` label with an `instance_id` label on the `rgw`
metrics.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
src/pybind/mgr/mgr_module.py

index 657cf2cceffe4dd80fc9c58080e8417a06ccb6f4..d8d19a7b0d48f1b86a2d3077a42b2d54522cdd04 100644 (file)
@@ -1296,7 +1296,13 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin):
 
     def _perfpath_to_path_labels(self, daemon: str,
                                  path: str) -> Tuple[str, Tuple[str, ...], Tuple[str, ...]]:
-        label_names = ("ceph_daemon",)  # type: Tuple[str, ...]
+        if daemon.startswith('rgw.'):
+            label_name = 'instance_id'
+            daemon = daemon[len('rgw.'):]
+        else:
+            label_name = 'ceph_daemon'
+
+        label_names = (label_name,)  # type: Tuple[str, ...]
         labels = (daemon,)  # type: Tuple[str, ...]
 
         if daemon.startswith('rbd-mirror.'):