From d1e5d58e014bf122a6c3156391dd38e2583fafa8 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:04:44 -0700 Subject: [PATCH] Add some debug logging for k8s --- src/pages/api/widgets/kubernetes.js | 3 ++- src/utils/config/service-helpers.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/api/widgets/kubernetes.js b/src/pages/api/widgets/kubernetes.js index 0859212fa..778a6aa13 100644 --- a/src/pages/api/widgets/kubernetes.js +++ b/src/pages/api/widgets/kubernetes.js @@ -22,11 +22,12 @@ export default async function handler(req, res) { .then((response) => response.body) .catch((error) => { logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response); + logger.debug(error); return null; }); if (!nodes) { return res.status(500).send({ - error: "unknown error", + error: "An error occurred while fetching nodes, check logs for more details.", }); } let cpuTotal = 0; diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index e8070bc70..0dfbc9448 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -198,6 +198,7 @@ export async function servicesFromKubernetes() { .then((response) => response.body) .catch((error) => { logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response); + logger.debug(error); return null; }); @@ -215,6 +216,7 @@ export async function servicesFromKubernetes() { error.body, error.response, ); + logger.debug(error); } return []; @@ -231,6 +233,7 @@ export async function servicesFromKubernetes() { error.body, error.response, ); + logger.debug(error); } return []; @@ -300,6 +303,7 @@ export async function servicesFromKubernetes() { constructedService = JSON.parse(substituteEnvironmentVars(JSON.stringify(constructedService))); } catch (e) { logger.error("Error attempting k8s environment variable substitution."); + logger.debug(e); } return constructedService;