From cd55260a98806cfcbe269f87f4ffd2be2ff0458f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mac=C3=ADk?= Date: Mon, 2 Dec 2024 11:25:02 +0100 Subject: [PATCH] feat(log-level): Make RHDH log level configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel MacĂ­k --- Makefile | 3 +++ ci-scripts/rhdh-setup/deploy.sh | 2 ++ .../template/backstage/helm/chart-values.image-override.yaml | 2 +- .../rhdh-setup/template/backstage/helm/chart-values.yaml | 2 +- ci-scripts/rhdh-setup/template/backstage/olm/backstage.yaml | 2 +- test.env | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 377a9db..4112a92 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,9 @@ export DURATION ?= 1m # Used to set --spawn-rate option of locust CLI (Rate to spawn users at (users per second)). See https://docs.locust.io/en/stable/configuration.html#command-line-options for details export SPAWN_RATE ?= 20 +# Used to set logging level of RHDH +export RHDH_LOG_LEVEL ?= warn + # RHDH image to deploy. Uncomment and set to override RHDH image to deploy and test. export RHDH_IMAGE_REGISTRY ?= export RHDH_IMAGE_REPO ?= diff --git a/ci-scripts/rhdh-setup/deploy.sh b/ci-scripts/rhdh-setup/deploy.sh index 2dabd77..291e939 100755 --- a/ci-scripts/rhdh-setup/deploy.sh +++ b/ci-scripts/rhdh-setup/deploy.sh @@ -55,6 +55,7 @@ export AUTH_PROVIDER="${AUTH_PROVIDER:-''}" export ENABLE_RBAC="${ENABLE_RBAC:-false}" export ENABLE_PROFILING="${ENABLE_PROFILING:-false}" export RBAC_POLICY="${RBAC_POLICY:-all_groups_admin}" +export RHDH_LOG_LEVEL="${RHDH_LOG_LEVEL:-warn}" export PSQL_LOG="${PSQL_LOG:-true}" export RHDH_METRIC="${RHDH_METRIC:-true}" @@ -362,6 +363,7 @@ install_rhdh_with_helm() { ${RHDH_IMAGE_TAG} \ ${RHDH_NAMESPACE} \ ${RHDH_METRIC} \ + ${RHDH_LOG_LEVEL} \ ${COOKIE_SECRET} \ ' <"$TMP_DIR/chart-values.temp.yaml" >"$TMP_DIR/chart-values.yaml" if [ -n "${RHDH_RESOURCES_CPU_REQUESTS}" ]; then yq -i '.upstream.backstage.resources.requests.cpu = "'"${RHDH_RESOURCES_CPU_REQUESTS}"'"' "$TMP_DIR/chart-values.yaml"; fi diff --git a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml index 4dcb875..789c37c 100644 --- a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml +++ b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml @@ -90,7 +90,7 @@ upstream: key: CLIENT_SECRET name: keycloak-client-secret-backstage - name: LOG_LEVEL - value: "warn" + value: "${RHDH_LOG_LEVEL}" - name: NODE_TLS_REJECT_UNAUTHORIZED value: "0" image: diff --git a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml index 3ae4330..9348a88 100644 --- a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml +++ b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml @@ -90,7 +90,7 @@ upstream: key: CLIENT_SECRET name: keycloak-client-secret-backstage - name: LOG_LEVEL - value: "warn" + value: "${RHDH_LOG_LEVEL}" - name: NODE_TLS_REJECT_UNAUTHORIZED value: "0" installDir: /app diff --git a/ci-scripts/rhdh-setup/template/backstage/olm/backstage.yaml b/ci-scripts/rhdh-setup/template/backstage/olm/backstage.yaml index 6b21a3b..904ab1f 100644 --- a/ci-scripts/rhdh-setup/template/backstage/olm/backstage.yaml +++ b/ci-scripts/rhdh-setup/template/backstage/olm/backstage.yaml @@ -24,7 +24,7 @@ spec: - name: KEYCLOAK_REALM value: "backstage" - name: LOG_LEVEL - value: "warn" + value: "${RHDH_LOG_LEVEL}" - name: NODE_TLS_REJECT_UNAUTHORIZED value: "0" secrets: diff --git a/test.env b/test.env index fc58e74..8324777 100644 --- a/test.env +++ b/test.env @@ -58,6 +58,7 @@ # export RBAC_POLICY=all_groups_admin # export RBAC_POLICY_SIZE=10000 # export ENABLE_PROFILING=false +# export RHDH_LOG_LEVEL=warn ## Scalability testing # export SCALE_WORKERS="1 2"