Fix logger reference

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala committed 2020-11-24 09:23:42 +02:00
1 parent 1d5dbb0788
commit d13917c197
1 file changed
+2 -1
+2 -1
View File
@@ -3,6 +3,7 @@ import { LensApiRequest } from "../router";
import { LensApi } from "../lens-api";
import { Cluster, ClusterMetadataKey } from "../cluster";
import { ClusterPrometheusMetadata } from "../../common/cluster-store";
import logger from "../logger";
export type IMetricsQuery = string | string[] | {
[metricName: string]: string;
@@ -24,7 +25,7 @@ async function loadMetrics(promQueries: string[], cluster: Cluster, prometheusPa
return await cluster.getMetrics(prometheusPath, { query, ...queryParams });
} catch (error) {
if (lastAttempt || (error?.statusCode >= 400 && error?.statusCode < 500)) {
logger.error("[Metrics]: metrics not available", { err });
logger.error("[Metrics]: metrics not available", { error });
throw new Error("Metrics not available");
}