Skip to content

Commit

Permalink
resilience to bad instance param
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Aug 27, 2018
1 parent 3f89652 commit 383389b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datadog_checks_base/datadog_checks/checks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ def __init__(self, *args, **kwargs):
}

# Setup metric limits
metric_limit = self.DEFAULT_METRIC_LIMIT
if len(self.instances) and isinstance(self.instances[0], dict):
try:
metric_limit = self.instances[0].get("max_returned_metrics", self.DEFAULT_METRIC_LIMIT)
except Exception:
metric_limit = self.DEFAULT_METRIC_LIMIT
if metric_limit > 0:
self.metric_limiter = Limiter("metrics", metric_limit, self.warning)

Expand Down

0 comments on commit 383389b

Please sign in to comment.