'Get all metrics, including the ones that are tagged.
This is the preferred method to retrieve metrics
@return the list of samples
@rtype [(metric_name, timestamp, value, {"tags": ["tag1", "tag2"]}), ...]'

def get_metrics(self, expire=True):

    metrics = []
    for m in self._sample_store:
        try:
            for key in self._sample_store[m]:
                (tags, device_name) = key
                try:
                    (ts, val, hostname, device_name) = self.get_sample_with_timestamp(m, tags, device_name, expire)
                except UnknownValue:
                    continue
                attributes = {}
                if tags:
                    attributes['tags'] = list(tags)
                if hostname:
                    attributes['host_name'] = hostname
                if device_name:
                    attributes['device_name'] = device_name
                metrics.append((m, int(ts), val, attributes))
        except Exception:
            pass
    return metrics
