Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus: Properly split the port off IPv6 addresses #36594

Merged
merged 1 commit into from Sep 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/pybind/mgr/prometheus/module.py
Expand Up @@ -510,7 +510,7 @@ def get_quorum_status(self):
host_version = servers.get((id_, 'mon'), ('', ''))
self.metrics['mon_metadata'].set(1, (
'mon.{}'.format(id_), host_version[0],
mon['public_addr'].split(':')[0], rank,
mon['public_addr'].rsplit(':', 1)[0], rank,
host_version[1]
))
in_quorum = int(rank in mon_status['quorum'])
Expand Down Expand Up @@ -619,8 +619,8 @@ def get_metadata_and_osd_status(self):
# id can be used to link osd metrics and metadata
id_ = osd['osd']
# collect osd metadata
p_addr = osd['public_addr'].split(':')[0]
c_addr = osd['cluster_addr'].split(':')[0]
p_addr = osd['public_addr'].rsplit(':', 1)[0]
c_addr = osd['cluster_addr'].rsplit(':', 1)[0]
if p_addr == "-" or c_addr == "-":
self.log.info(
"Missing address metadata for osd {0}, skipping occupation"
Expand Down