Skip to content

Commit

Permalink
Handle errors in lambda stats during graphite push.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterScott committed Dec 14, 2011
1 parent 8551533 commit 4dd2725
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/greplin/scales/graphite.py
Expand Up @@ -19,6 +19,7 @@

import os
import threading
import logging
import time


Expand Down Expand Up @@ -63,7 +64,11 @@ def push(self, statsDict=None, prefix=None, path=None):
self.push(value, '%s%s.' % (prefix, self._sanitize(name)), subpath)
else:
if hasattr(value, '__call__'):
value = value()
try:
value = value()
except: # pylint: disable=W0702
value = None
logging.exception('Error when calling stat function for graphite push')
for rule in self.rules:
if not rule(name, value):
break
Expand Down

0 comments on commit 4dd2725

Please sign in to comment.