Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-10-13 11:13:26 -04:00
1 parent 57f71d3224
commit 160b29c004
8 files changed
+167 -146

No files matched your search

+4 -2
View File
@@ -44,11 +44,13 @@ async function loadMetrics(promQueries: string[], cluster: Cluster, prometheusPa
async function loadMetric(query: string): Promise<any> {
async function loadMetricHelper(): Promise<any> {
for (const [attempt, lastAttempt] of ATTEMPTS.entries()) { // retry
const reqParams = { query, ...queryParams };
try {
return await getMetrics(cluster, prometheusPath, { query, ...queryParams });
return await getMetrics(cluster, prometheusPath, reqParams);
} catch (error) {
if (lastAttempt || (error?.statusCode >= 400 && error?.statusCode < 500)) {
logger.error("[Metrics]: metrics not available", { error });
logger.error("[Metrics]: metrics not available", { ...error.error, reqParams });
throw new Error("Metrics not available");
}