From 047f6cf951e86f561d3c20d0dd15c7bce38657ea Mon Sep 17 00:00:00 2001 From: Tobias Bauriedel Date: Thu, 15 Aug 2024 11:58:21 +0200 Subject: [PATCH] update to support carbonapi --- library/Graphite/Graphing/MetricsQuery.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/library/Graphite/Graphing/MetricsQuery.php b/library/Graphite/Graphing/MetricsQuery.php index 93d0c907..77691b97 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()