(self, instance, base_url, object_type, max_detailed, filters, limit_vhosts, custom_tags)
instance: the check instance
        base_url: the url of the rabbitmq management api (e.g. http://localhost:15672/api)
        object_type: either QUEUE_TYPE or NODE_TYPE or EXCHANGE_TYPE
        max_detailed: the limit of objects to collect for this type
        filters: explicit or regexes filters of specified queues or nodes (specified in the yaml file)
        limit_vhosts: collection of vhosts to limit to
        custom_tags: Custom tags to get applied to all metrics
instance: the check instance
        base_url: the url of the rabbitmq management api (e.g. http://localhost:15672/api)
        object_type: either QUEUE_TYPE or NODE_TYPE or EXCHANGE_TYPE
        max_detailed: the limit of objects to collect for this type
        filters: explicit or regexes filters of specified queues or nodes (specified in the yaml file)
        limit_vhosts: collection of vhosts to limit to
        custom_tags: Custom tags to get applied to all metrics
instance : the check instance base_url : the url of the rabbitmq management api ( e . g . http : // localhost : 15672 / api ) object_type : either QUEUE_TYPE or NODE_TYPE or EXCHANGE_TYPE max_detailed : the limit of objects to collect for this type filters : explicit or regexes filters of specified queues or nodes ( specified in the yaml file ) limit_vhosts : collection of vhosts to limit to custom_tags : Custom tags to get applied to all metrics
def get_stats(self, instance, base_url, object_type, max_detailed, filters, limit_vhosts, custom_tags):
        """
        instance: the check instance
        base_url: the url of the rabbitmq management api (e.g. http://localhost:15672/api)
        object_type: either QUEUE_TYPE or NODE_TYPE or EXCHANGE_TYPE
        max_detailed: the limit of objects to collect for this type
        filters: explicit or regexes filters of specified queues or nodes (specified in the yaml file)
        limit_vhosts: collection of vhosts to limit to
        custom_tags: Custom tags to get applied to all metrics
        """
        # Make a copy of this list as we will remove items from it at each
        # iteration
        explicit_filters = list(filters['explicit'])
        regex_filters = filters['regexes']
        data = self._get_object_data(instance, base_url, object_type, limit_vhosts)

        if len(explicit_filters) > max_detailed:
            raise Exception("The maximum number of {} you can specify is {}.".format(object_type, max_detailed))

        # a list of queues/nodes is specified. We process only those
        data = self._filter_list(
            data, explicit_filters, regex_filters, object_type, instance.get("tag_families", False)
        )

        # if no filters are specified, check everything according to the limits
        if len(data) > ALERT_THRESHOLD * max_detailed:
            # Post a message on the dogweb stream to warn
            self.alert(base_url, max_detailed, len(data), object_type, custom_tags)

        data_lines_sent = 0
        for data_line in data:
            if data_lines_sent >= max_detailed:
                # Display a warning in the info page
                msg = (
                    "Too many items to fetch. "
                    "You must choose the {} you are interested in by editing the rabbitmq.d/conf.yaml configuration "
                    "file or get in touch with Datadog support"
                ).format(object_type)
                self.warning(msg)
                break
            # We truncate the list if it's above the limit
            metrics_sent = self._get_metrics(data_line, object_type, custom_tags)
            if metrics_sent >= 1:
                data_lines_sent += 1

        # get a list of the number of bindings on a given queue
        # /api/queues/vhost/name/bindings
        if object_type is QUEUE_TYPE:
            self._get_queue_bindings_metrics(base_url, custom_tags, data, object_type)
def get_stats ( self , instance , base_url , object_type , max_detailed , filters , limit_vhosts , custom_tags ) : # Make a copy of this list as we will remove items from it at each # iteration explicit_filters = list ( filters [ 'explicit' ] ) regex_filters = filters [ 'regexes' ] data = self . _get_object_data ( instance , base_url , object_type , limit_vhosts ) if len ( explicit_filters ) > max_detailed : raise Exception ( "The maximum number of {} you can specify is {}." . format ( object_type , max_detailed ) ) # a list of queues/nodes is specified. We process only those data = self . _filter_list ( data , explicit_filters , regex_filters , object_type , instance . get ( "tag_families" , False ) ) # if no filters are specified, check everything according to the limits if len ( data ) > ALERT_THRESHOLD * max_detailed : # Post a message on the dogweb stream to warn self . alert ( base_url , max_detailed , len ( data ) , object_type , custom_tags ) data_lines_sent = 0 for data_line in data : if data_lines_sent >= max_detailed : # Display a warning in the info page msg = ( "Too many items to fetch. " "You must choose the {} you are interested in by editing the rabbitmq.d/conf.yaml configuration " "file or get in touch with Datadog support" ) . format ( object_type ) self . warning ( msg ) break # We truncate the list if it's above the limit metrics_sent = self . _get_metrics ( data_line , object_type , custom_tags ) if metrics_sent >= 1 : data_lines_sent += 1 # get a list of the number of bindings on a given queue # /api/queues/vhost/name/bindings if object_type is QUEUE_TYPE : self . _get_queue_bindings_metrics ( base_url , custom_tags , data , object_type )