Skip to content

Commit

Permalink
fixing daemon_id for rook environment
Browse files Browse the repository at this point in the history
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
  • Loading branch information
rkachach committed Feb 7, 2024
1 parent e52cd13 commit fda49e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pybind/mgr/prometheus/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,12 +1296,15 @@ def _get_pool_info(pool: Dict[str, Any]) -> Tuple[str, str]:
if modify_instance_id:
daemons = raise_if_exception(self.list_daemons(daemon_type='rgw'))
for daemon in daemons:
if daemon.daemon_id and '.' in daemon.daemon_id:
daemon_id_prefix = daemon.daemon_id.split(".")[2]
else:
daemon_id_prefix = daemon.daemon_id if daemon.daemon_id else ""
self.metrics['rgw_metadata'].set(1,
('{}.{}'.format(str(daemon.daemon_type),
str(daemon.daemon_id)),
(f"{daemon.daemon_type}.{daemon.daemon_id}",
str(daemon.hostname),
str(daemon.version),
str(daemon.daemon_id).split(".")[2]))
daemon_id_prefix))
for key, value in servers.items():
service_id, service_type = key
if service_type == 'rgw' and not modify_instance_id:
Expand Down

0 comments on commit fda49e9

Please sign in to comment.