Wrap call to CloudWatch in try/catch block.

This commit is contained in:
Jimmy Zelinskie 2015-01-16 12:14:11 -05:00
parent a68bad1c3a
commit 0122a6698f

View file

@ -43,12 +43,15 @@ class SendToCloudWatch(Process):
self.daemon = True
def run(self):
logger.debug('Starting cloudwatch sender process.')
logger.debug('Starting CloudWatch sender process.')
connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key)
while True:
put_metric_args, kwargs = self._put_metrics_queue.get()
logger.debug('Got queued put metrics reqeust.')
connection.put_metric_data(*put_metric_args, **kwargs)
logger.debug('Got queued put metrics request.')
try:
connection.put_metric_data(*put_metric_args, **kwargs)
except:
logger.exception('Writing to CloudWatch failed')
class QueueMetrics(object):