Esempio n. 1
0
    def service_check(self,
                      name,
                      status,
                      tags=None,
                      hostname=None,
                      message=None,
                      raw=False):
        # type: (str, ServiceCheckStatus, List[str], str, str, bool) -> None
        """Send the status of a service.

        :param str name: the name of the service check.
        :param status: a constant describing the service status.
        :type status: :py:class:`datadog_checks.base.constants.ServiceCheck`
        :param list tags: (optional) a list of tags to associate with this check.
        :param str message: (optional) additional information or a description of why this status occurred.
        :param bool raw: (optional) whether to ignore any defined namespace prefix
        """
        tags = self._normalize_tags_type(tags or [])
        if hostname is None:
            hostname = ''
        if message is None:
            message = ''
        else:
            message = to_native_string(message)

        aggregator.submit_service_check(self, self.check_id,
                                        self._format_namespace(name, raw),
                                        status, tags, hostname, message)
Esempio n. 2
0
    def service_check(self,
                      name,
                      status,
                      tags=None,
                      hostname=None,
                      message=None):
        """Send the status of a service.

        :param str name: the name of the service check.
        :param status: a constant describing the service status.
        :type status: :py:class:`datadog_checks.base.constants.ServiceCheck`
        :param list tags: (optional) a list of tags to associate with this check.
        :param str message: (optional) additional information or a description of why this status occurred.
        """
        tags = self._normalize_tags_type(tags)
        if hostname is None:
            hostname = ''
        if message is None:
            message = ''
        else:
            message = to_string(message)

        aggregator.submit_service_check(self, self.check_id,
                                        self._format_namespace(name), status,
                                        tags, hostname, message)
Esempio n. 3
0
    def service_check(self,
                      name,
                      status,
                      tags=None,
                      hostname=None,
                      message=None,
                      raw=False):
        # type: (str, ServiceCheckStatus, Sequence[str], str, str, bool) -> None
        """Send the status of a service.

        - **name** (_str_) - the name of the service check
        - **status** (_int_) - a constant describing the service status.
        - **tags** (_List[str]_) - a list of tags to associate with this service check
        - **message** (_str_) - additional information or a description of why this status occurred.
        - **raw** (_bool_) - whether to ignore any defined namespace prefix
        """
        tags = self._normalize_tags_type(tags or [])
        if hostname is None:
            hostname = ''
        if message is None:
            message = ''
        else:
            message = to_native_string(message)

        message = self.sanitize(message)

        aggregator.submit_service_check(self, self.check_id,
                                        self._format_namespace(name, raw),
                                        status, tags, hostname, message)
Esempio n. 4
0
    def service_check(self, name, status, tags=None, hostname=None, message=None):
        tags = self._normalize_tags_type(tags)
        if hostname is None:
            hostname = ""
        if message is None:
            message = ""

        aggregator.submit_service_check(self, self.check_id, name, status, tags, hostname, message)
Esempio n. 5
0
    def service_check(self, name, status, tags=None, hostname=None, message=None):
        tags = self._normalize_tags_type(tags)
        if hostname is None:
            hostname = ""
        if message is None:
            message = ""

        aggregator.submit_service_check(self, self.check_id, name, status, tags, hostname, message)
Esempio n. 6
0
    def service_check(self, name, status, tags=None, hostname=None, message=None):
        tags = self._normalize_tags_type(tags)
        if hostname is None:
            hostname = b''
        if message is None:
            message = b''
        else:
            message = ensure_bytes(message)

        aggregator.submit_service_check(self, self.check_id, ensure_bytes(name), status, tags, hostname, message)