Skip to content

Commit

Permalink
pybind/mgr/mgr_module.py: Set instance_id label for rgw
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
BenoitKnecht committed Jan 11, 2022
1 parent 2db1aaa commit 9f6573b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pybind/mgr/mgr_module.py
Expand Up @@ -1296,7 +1296,13 @@ def _stattype_to_str(self, stattype: int) -> str:

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.'):
Expand Down

0 comments on commit 9f6573b

Please sign in to comment.