Skip to content

Commit

Permalink
Add exception for good service check messages
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhan289 committed Aug 25, 2021
1 parent 6eb6800 commit 8d3a350
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datadog_checks_base/datadog_checks/base/stubs/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from six import iteritems

from datadog_checks.base.constants import ServiceCheck
from ..utils.common import ensure_unicode, to_native_string
from .common import HistogramBucketStub, MetricStub, ServiceCheckStub
from .similar import build_similar_elements_msg
Expand Down Expand Up @@ -123,6 +124,9 @@ def submit_metric_e2e(
self._metrics[name].append(MetricStub(name, mtype, value, tags, hostname, device))

def submit_service_check(self, check, check_id, name, status, tags, hostname, message):
if status == ServiceCheck.OK and message:
raise Exception("Expected empty message on OK service check")

check_tag_names(name, tags)
self._service_checks[name].append(ServiceCheckStub(check_id, name, status, tags, hostname, message))

Expand Down

0 comments on commit 8d3a350

Please sign in to comment.