Skip to content

Commit

Permalink
Merge "[Exporter] Check auxiliary services in odspl"
Browse files Browse the repository at this point in the history
  • Loading branch information
MOS CI authored and Gerrit Code Review committed Dec 5, 2024
2 parents 9b6d9f5 + 01b5c1f commit cb931fa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions rockoon/exporter/collectors/openstack/aodh.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class OsdplAodhMetricCollector(base.OpenStackBaseMetricCollector):
_name = "osdpl_aodh"
_description = "OpenStack Orchestration service metrics"
_os_service_types = ["alarm", "alarming"]
_osdpl_service_name = "alarming"

@utils.timeit
def init_families(self):
Expand Down
6 changes: 6 additions & 0 deletions rockoon/exporter/collectors/openstack/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class OpenStackBaseMetricCollector(base.BaseMetricsCollector):
# Service type to check for presence is catalog
_os_service_types = []
_osdpl_service_name = ""

def __init__(self):
super().__init__()
Expand Down Expand Up @@ -62,4 +63,9 @@ def can_collect_data(self):
return False
if not self.is_service_available:
return False
if self._osdpl_service_name:
if self._osdpl_service_name not in self.osdpl.obj["spec"][
"features"
].get("services", []):
return False
return True
1 change: 1 addition & 0 deletions rockoon/exporter/collectors/openstack/ironic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class OsdplIronicMetricCollector(base.OpenStackBaseMetricCollector):
_name = "osdpl_ironic"
_description = "OpenStack Baremetal service metrics"
_os_service_types = ["baremetal"]
_osdpl_service_name = "baremetal"

@utils.timeit
def init_families(self):
Expand Down
1 change: 1 addition & 0 deletions rockoon/exporter/collectors/openstack/manila.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class OsdplManilaMetricCollector(base.OpenStackBaseMetricCollector):
_name = "osdpl_manila"
_description = "OpenStack Shared file system service metrics"
_os_service_types = ["shared-file-system", "sharev2", "share"]
_osdpl_service_name = "shared-file-system"

@utils.timeit
def init_families(self):
Expand Down
1 change: 1 addition & 0 deletions rockoon/exporter/collectors/openstack/masakari.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class OsdplMasakariMetricCollector(base.OpenStackBaseMetricCollector):
_name = "osdpl_masakari"
_description = "OpenStack Instance HA service metrics"
_os_service_types = ["instance-ha", "ha"]
_osdpl_service_name = "instance-ha"

@utils.timeit
def init_families(self):
Expand Down

0 comments on commit cb931fa

Please sign in to comment.