diff --git a/library/Graphite/Graphing/MetricsQuery.php b/library/Graphite/Graphing/MetricsQuery.php index 93d0c90..77691b9 100644 --- a/library/Graphite/Graphing/MetricsQuery.php +++ b/library/Graphite/Graphing/MetricsQuery.php @@ -169,15 +169,21 @@ public function fetchColumn() } $client = $this->dataSource->getClient(); - $url = Url::fromPath('metrics/expand', [ + $url = Url::fromPath('metrics/find', [ 'query' => $this->base->resolve($filter, '*') ]); $res = Json::decode($client->request($url)); - natsort($res->results); - IPT::recordf('Fetched %s metric(s) from %s', count($res->results), (string) $client->completeUrl($url)); + $results = []; + foreach ($res as $item) { + $results[] = $item->id; + } + + natsort($results); + + IPT::recordf('Fetched %s metric(s) from %s', count($results), (string) $client->completeUrl($url)); - return array_values($res->results); + return array_values($results); } public function fetchOne()