(self, payload, additional_tags=None, metrics_to_collect=None, prefix="")
Common utility method used to submit a pre-formatted payload to Datadog. The format is standard throughout
        this integration, each numerical value in the payload comes from nested dictionary keys. The corresponding
        metric name is the concatenation of all keys leading to a value, joined by 'dots'.

        For example, the following payload:
        {
            "db": {
                "foo": 2,
                "bar": {
                    "baz": 3
                }
            }
        }
        produces two metrics, db.foo with value 2 and db.bar.baz with value 3.

        :param payload: The nested payload described earlier.
        :param additional_tags: Additional tags to submit along self.base_tags
        :param metrics_to_collect: All the valid metric names that can be collected with its submission type.
        :param prefix: A prefix to add to all metrics
Common utility method used to submit a pre-formatted payload to Datadog. The format is standard throughout
        this integration, each numerical value in the payload comes from nested dictionary keys. The corresponding
        metric name is the concatenation of all keys leading to a value, joined by 'dots'.
Common utility method used to submit a pre - formatted payload to Datadog . The format is standard throughout this integration each numerical value in the payload comes from nested dictionary keys . The corresponding metric name is the concatenation of all keys leading to a value joined by dots .
def _submit_payload(self, payload, additional_tags=None, metrics_to_collect=None, prefix=""):
        """Common utility method used to submit a pre-formatted payload to Datadog. The format is standard throughout
        this integration, each numerical value in the payload comes from nested dictionary keys. The corresponding
        metric name is the concatenation of all keys leading to a value, joined by 'dots'.

        For example, the following payload:
        {
            "db": {
                "foo": 2,
                "bar": {
                    "baz": 3
                }
            }
        }
        produces two metrics, db.foo with value 2 and db.bar.baz with value 3.

        :param payload: The nested payload described earlier.
        :param additional_tags: Additional tags to submit along self.base_tags
        :param metrics_to_collect: All the valid metric names that can be collected with its submission type.
        :param prefix: A prefix to add to all metrics
        """
        if metrics_to_collect is None:
            metrics_to_collect = self.metrics_to_collect
        tags = self.base_tags + (additional_tags or [])
        # Go through the metrics and save the values
        for metric_name in metrics_to_collect:
            # each metric is of the form: x.y.z with z optional
            # and can be found at status[x][y][z]
            value = payload

            try:
                for c in metric_name.split("."):
                    value = value[c]
            except KeyError:
                continue

            # value is now status[x][y][z]
            if not isinstance(value, (int, long, float)):
                raise TypeError(
                    u"{0} value is a {1}, it should be an int, a float or a long instead.".format(
                        metric_name, type(value)
                    )
                )

            # Submit the metric
            submit_method = (
                metrics_to_collect[metric_name][0]
                if isinstance(metrics_to_collect[metric_name], tuple)
                else metrics_to_collect[metric_name]
            )
            metric_name_alias = (
                metrics_to_collect[metric_name][1]
                if isinstance(metrics_to_collect[metric_name], tuple)
                else metric_name
            )
            metric_name_alias = self._normalize(metric_name_alias, submit_method, prefix)
            submit_method(self.check, metric_name_alias, value, tags=tags)
            if metric_name_alias.endswith("countps"):
                # Keep old incorrect metric name (only 'top' metrics are affected)
                self.gauge(metric_name_alias[:-2], value, tags=tags)
def _submit_payload ( self , payload , additional_tags = None , metrics_to_collect = None , prefix = "" ) : if metrics_to_collect is None : metrics_to_collect = self . metrics_to_collect tags = self . base_tags + ( additional_tags or [ ] ) # Go through the metrics and save the values for metric_name in metrics_to_collect : # each metric is of the form: x.y.z with z optional # and can be found at status[x][y][z] value = payload try : for c in metric_name . split ( "." ) : value = value [ c ] except KeyError : continue # value is now status[x][y][z] if not isinstance ( value , ( int , long , float ) ) : raise TypeError ( u"{0} value is a {1}, it should be an int, a float or a long instead." . format ( metric_name , type ( value ) ) ) # Submit the metric submit_method = ( metrics_to_collect [ metric_name ] [ 0 ] if isinstance ( metrics_to_collect [ metric_name ] , tuple ) else metrics_to_collect [ metric_name ] ) metric_name_alias = ( metrics_to_collect [ metric_name ] [ 1 ] if isinstance ( metrics_to_collect [ metric_name ] , tuple ) else metric_name ) metric_name_alias = self . _normalize ( metric_name_alias , submit_method , prefix ) submit_method ( self . check , metric_name_alias , value , tags = tags ) if metric_name_alias . endswith ( "countps" ) : # Keep old incorrect metric name (only 'top' metrics are affected) self . gauge ( metric_name_alias [ : - 2 ] , value , tags = tags )