Skip to content

Commit

Permalink
Merge pull request #1 from DataDog/master
Browse files Browse the repository at this point in the history
Get upstream commits from DataDog
  • Loading branch information
Igor Polishchuk committed Jan 5, 2015
2 parents 0561416 + 0335e11 commit c927479
Show file tree
Hide file tree
Showing 20 changed files with 400 additions and 536 deletions.
16 changes: 16 additions & 0 deletions aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,22 @@ def flush(self):
self.count = 0
return metrics

def get_formatter(config):
formatter = api_formatter

if config['statsd_metric_namespace']:
def metric_namespace_formatter_wrapper(metric, value, timestamp, tags,
hostname=None, device_name=None, metric_type=None, interval=None):
metric_prefix = config['statsd_metric_namespace']
if metric_prefix[-1] != '.':
metric_prefix += '.'

return api_formatter(metric_prefix + metric, value, timestamp, tags, hostname,
device_name, metric_type, interval)

formatter = metric_namespace_formatter_wrapper
return formatter


def api_formatter(metric, value, timestamp, tags, hostname=None, device_name=None,
metric_type=None, interval=None):
Expand Down
2 changes: 1 addition & 1 deletion checks.d/couch.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_data(self, server, instance):
overall_stats = self._get_stats(url, instance)
except urllib2.URLError as e:
self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL,
tags=service_check_tags, message=e.reason)
tags=service_check_tags, message=str(e.reason))
raise
except Exception as e:
self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL,
Expand Down
2 changes: 1 addition & 1 deletion checks.d/couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_data(self, server, instance):
raise Exception("No data returned from couchbase endpoint: %s" % url)
except urllib2.URLError as e:
self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL,
tags=service_check_tags, message=e.reason)
tags=service_check_tags, message=str(e.reason))
raise
except Exception as e:
self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL,
Expand Down
Loading

0 comments on commit c927479

Please sign in to comment.