var lookup = {},
    lookup_histogram = {},
    result = [];

JSON.parse(value).forEach(function (item) {
    if (item.name === 'apiserver_request_duration_seconds_count') {
        var label_verb = item.labels.verb;
        if (lookup[label_verb]) {
            return;
        }
        lookup[label_verb] = 1;
        result.push({
            '{#TYPE}': 'totals',
            '{#VERB}': label_verb
        });

      }
    else if  (item.name === 'apiserver_request_duration_seconds_bucket') {
        var labels = item.labels.verb + item.labels.le;

        if (lookup_histogram[labels]) {
            return;
        }

        lookup_histogram[labels] = 1;
        result.push({
            '{#TYPE}': 'buckets',
            '{#VERB}': item.labels.verb,
            '{#LE}': item.labels.le
        });
    }
});

return JSON.stringify(result);