(self, data, custom_tags=None)
Report a service check, tagged by the service and the backend.
        Statuses are defined in `STATUS_TO_SERVICE_CHECK` mapping.
Report a service check, tagged by the service and the backend.
        Statuses are defined in `STATUS_TO_SERVICE_CHECK` mapping.
Report a service check tagged by the service and the backend . Statuses are defined in STATUS_TO_SERVICE_CHECK mapping .
def _process_service_check(self, data, custom_tags=None):
        """Report a service check, tagged by the service and the backend.
        Statuses are defined in `STATUS_TO_SERVICE_CHECK` mapping.
        """
        custom_tags = [] if custom_tags is None else custom_tags
        service_name = data['pxname']
        status = data['status']
        haproxy_hostname = to_string(self.hostname)
        check_hostname = haproxy_hostname if self.tag_service_check_by_host else ''

        if self._is_service_excl_filtered(service_name):
            return

        if status in Services.STATUS_TO_SERVICE_CHECK:
            service_check_tags = ["haproxy_service:%s" % service_name]
            service_check_tags.extend(custom_tags)
            self._handle_legacy_service_tag(service_check_tags, service_name)

            hostname = data['svname']
            if data['back_or_front'] == Services.BACKEND:
                service_check_tags.append('backend:%s' % hostname)

            status = Services.STATUS_TO_SERVICE_CHECK[status]
            message = (
                "%s reported %s:%s %s" % (haproxy_hostname, service_name, hostname, status)
                if status is not AgentCheck.OK
                else None
            )
            self.service_check(
                self.SERVICE_CHECK_NAME, status, message=message, hostname=check_hostname, tags=service_check_tags
            )
def _process_service_check ( self , data , custom_tags = None ) : custom_tags = [ ] if custom_tags is None else custom_tags service_name = data [ 'pxname' ] status = data [ 'status' ] haproxy_hostname = to_string ( self . hostname ) check_hostname = haproxy_hostname if self . tag_service_check_by_host else '' if self . _is_service_excl_filtered ( service_name ) : return if status in Services . STATUS_TO_SERVICE_CHECK : service_check_tags = [ "haproxy_service:%s" % service_name ] service_check_tags . extend ( custom_tags ) self . _handle_legacy_service_tag ( service_check_tags , service_name ) hostname = data [ 'svname' ] if data [ 'back_or_front' ] == Services . BACKEND : service_check_tags . append ( 'backend:%s' % hostname ) status = Services . STATUS_TO_SERVICE_CHECK [ status ] message = ( "%s reported %s:%s %s" % ( haproxy_hostname , service_name , hostname , status ) if status is not AgentCheck . OK else None ) self . service_check ( self . SERVICE_CHECK_NAME , status , message = message , hostname = check_hostname , tags = service_check_tags )