mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-08-24 04:16:18 +00:00
Prometheus, improve robust
This commit is contained in:
@@ -202,7 +202,10 @@ async function getPrometheusData(baseUrl: string, queryString: string) {
|
||||
.then((json) => {
|
||||
const jsonData = json.data;
|
||||
const graphData : Array<any> = jsonData.result[0]?.values.map((value: any) => ({x: value[0], y: +value[1]}));
|
||||
return graphData;
|
||||
if (graphData) {
|
||||
return graphData;
|
||||
}
|
||||
return [];
|
||||
});
|
||||
} catch (err) {
|
||||
log.error('Unable to send request', {err});
|
||||
|
||||
Reference in New Issue
Block a user