Skip to content

Commit e9a2cce

Browse files
committed
Change logging
1 parent eac868c commit e9a2cce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

iib_metrics_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def put_metric_to_gateway(metric_data, job):
4040
headers = {"Content-Type": "text/plain; version=0.0.4"}
4141
dest_url = "{0}/metrics/job/{1}".format(src_url, job)
4242
logger.info("Destination url: {0}".format(dest_url))
43+
# Debug info
4344
# logger.info("Metric data to push: {0}".format(metric_data))
4445
try:
4546
response = requests.put(dest_url, data=metric_data, headers=headers)
@@ -79,14 +80,14 @@ def main():
7980
logger.info("All metrics pushed successfully!")
8081
else:
8182
logger.warning("The status of broker is {0}\nOther metrics will not be collected!".format(status))
82-
put_metric_to_gateway(broker_data, broker_name)
83+
put_metric_to_gateway(metric_data=metric_data, job=broker_name)
84+
logger.info("Script finished in - {0} seconds -".format(time.time() - start_time))
8385
except PrometheusBadResponse as error:
8486
logger.error(error)
8587
except Exception as e:
8688
tb = sys.exc_info()[-1]
8789
stk = traceback.extract_tb(tb, 1)[0]
8890
logger.error("Function: {0}\n{1}".format(stk, e))
89-
logger.info("Script finished in - {0} seconds -".format(time.time() - start_time))
9091

9192

9293
if __name__ == "__main__":

0 commit comments

Comments
 (0)