Skip to content

Commit

Permalink
Merge pull request #92 from OpenMPDK/91-metrics-agent-should-continue…
Browse files Browse the repository at this point in the history
…-collecting-minio-rest-metrics-if-1-or-multiple-minios-are-down

Adding handling for if MINIO(s) go down
  • Loading branch information
nsarras authored Dec 9, 2023
2 parents ef478b9 + ccef4d5 commit 4a0c782
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions dss_metrics/minio_rest_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ def collect(self):

try:
for minio_endpoint in all_minio_endpoints:
miniocluster_id = utils.get_minio_cluster_uuid(
minio_endpoint, self.url_prefix,
self.cluster_id_url_suffix)
minio_metrics = self.get_minio_metrics_from_endpoint(
minio_endpoint)
try:
miniocluster_id = utils.get_minio_cluster_uuid(
minio_endpoint, self.url_prefix,
self.cluster_id_url_suffix)
minio_metrics = self.get_minio_metrics_from_endpoint(
minio_endpoint)
except Exception as error:
self.logger.error(f"""MINIO ENDPT: {minio_endpoint}
not reachable, ERROR: {str(error)}""")
continue

if not miniocluster_id or not minio_metrics:
self.logger.error("Failed to retrieve MINIO metadata")
Expand Down

0 comments on commit 4a0c782

Please sign in to comment.