Wrap call to CloudWatch in try/catch block.
This commit is contained in:
parent
a68bad1c3a
commit
0122a6698f
1 changed files with 6 additions and 3 deletions
|
@ -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):
|
||||
|
|
Reference in a new issue