Less noisy metrics-not-available error logging (#4602)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jari Kolehmainen authored and Jim Ehrismann committed 2022-01-19 11:30:56 -05:00
1 parent 6ee62ba003
commit f1ec353a83
1 file changed
+1 -1
+1 -1
View File
@@ -46,7 +46,7 @@ async function loadMetrics(promQueries: string[], cluster: Cluster, prometheusPa
return await getMetrics(cluster, prometheusPath, { query, ...queryParams }); return await getMetrics(cluster, prometheusPath, { query, ...queryParams });
} catch (error) { } catch (error) {
if (lastAttempt || (error?.statusCode >= 400 && error?.statusCode < 500)) { if (lastAttempt || (error?.statusCode >= 400 && error?.statusCode < 500)) {
logger.error("[Metrics]: metrics not available", error); logger.error("[Metrics]: metrics not available", error?.response ? error.response?.body : error);
throw new Error("Metrics not available"); throw new Error("Metrics not available");
} }