Skip to content

Commit

Permalink
so we know which metrics are being pulled (#303)
Browse files Browse the repository at this point in the history
* so we know which metrics are being pulled

* fix undefined response var
  • Loading branch information
bengland2 authored Jul 21, 2021
1 parent 2e6f4f5 commit 821084b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions snafu/utils/get_prometheus_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def get_all_metrics(self):
filename = tool_include_file
else:
filename = os.path.join(include_file_dir, "included_labels.json")
logger.info("using prometheus metric include file %s" % filename)

# open tools include file and loop through all
with open(filename, "r") as f:
Expand All @@ -84,6 +85,8 @@ def get_all_metrics(self):
response = self.pc.custom_query_range(query, self.start, self.end, step, None)

except Exception as e:
# response undefined at this point, we want to skip next for loop
response = []
logger.info(query)
logger.warn("failure to get metric results %s" % e)

Expand Down

0 comments on commit 821084b

Please sign in to comment.