mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix getMetrics
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
118c22c4b7
commit
1a837a094b
@ -528,7 +528,6 @@ export class Cluster implements ClusterModel, ClusterState {
|
||||
options.headers.host ??= `${this.id}.${this.kubeProxyUrl.host}`; // required in ClusterManager.getClusterForRequest()
|
||||
|
||||
try {
|
||||
console.log(url, options);
|
||||
const res = await got<T>(url, options);
|
||||
|
||||
return JSON.parse(String(res.body));
|
||||
@ -547,6 +546,7 @@ export class Cluster implements ClusterModel, ClusterState {
|
||||
timeout: 10000,
|
||||
method: "POST",
|
||||
form: searchParams,
|
||||
retry: 5,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ async function loadMetrics(promQueries: string[], cluster: Cluster, prometheusPa
|
||||
async function loadMetric(query: string) {
|
||||
const searchParams = { query, ...queryParams };
|
||||
|
||||
return loaders.get(query) ?? loaders.set(query, cluster.getMetrics(prometheusPath, { searchParams, retry: 5 })).get(query);
|
||||
return loaders.get(query) ?? loaders.set(query, cluster.getMetrics(prometheusPath, searchParams)).get(query);
|
||||
}
|
||||
|
||||
const responses = await Promise.all(queries.map(loadMetric));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user