From a98bce3667c7c3e55e6f4348f0433c20eb895d25 Mon Sep 17 00:00:00 2001 From: Charlie McBride <33269602+charliedmcb@users.noreply.github.com> Date: Thu, 11 Apr 2024 18:57:37 +0000 Subject: [PATCH 1/2] Allow for overriding and enabling logging of caller field --- charts/karpenter/templates/configmap-logging.yaml | 5 +++-- charts/karpenter/values.yaml | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/karpenter/templates/configmap-logging.yaml b/charts/karpenter/templates/configmap-logging.yaml index 0de88c183..e3610b404 100644 --- a/charts/karpenter/templates/configmap-logging.yaml +++ b/charts/karpenter/templates/configmap-logging.yaml @@ -17,7 +17,7 @@ data: "level": "{{ .Values.logConfig.logLevel.global }}", "development": false, "disableStacktrace": true, - "disableCaller": true, + "disableCaller": {{ .Values.logConfig.disableCaller }}, "sampling": { "initial": 100, "thereafter": 100 @@ -33,7 +33,8 @@ data: "messageKey": "message", "stacktraceKey": "stacktrace", "levelEncoder": "capital", - "timeEncoder": "iso8601" + "timeEncoder": "iso8601", + "callerEncoder": "full" } } loglevel.controller: {{ or .Values.controller.logLevel .Values.logConfig.logLevel.controller }} diff --git a/charts/karpenter/values.yaml b/charts/karpenter/values.yaml index 2d6d1c04d..9ef1041c2 100644 --- a/charts/karpenter/values.yaml +++ b/charts/karpenter/values.yaml @@ -152,6 +152,8 @@ logConfig: # -- Log errorOutputPaths - defaults to stderr only errorOutputPaths: - stderr + # -- Log disableCaller - can be overridden to false to log the caller field (file path, name, and line number) + disableCaller: true # -- Log encoding - defaults to json - must be one of 'json', 'console' logEncoding: json # -- Component-based log configuration From eb9343eb1399d5677c5c31b8178b57785c8a2f6a Mon Sep 17 00:00:00 2001 From: Charlie McBride Date: Thu, 11 Apr 2024 12:00:12 -0700 Subject: [PATCH 2/2] add make command --- Makefile-az.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile-az.mk b/Makefile-az.mk index b774fe993..9c0d4cb00 100755 --- a/Makefile-az.mk +++ b/Makefile-az.mk @@ -191,6 +191,9 @@ az-run-sample: ## Deploy sample Provisioner and workload (with 0 replicas, to be kubectl apply -f examples/v1beta1/general-purpose.yaml kubectl apply -f examples/workloads/inflate.yaml +az-enable-logging-caller: ## Enable logging the caller field (file path, name, and line number) + yq -i '.manifests.helm.releases[0].overrides.logConfig ."disableCaller" = false' skaffold.yaml + az-mc-show: ## show managed cluster az aks show --name $(AZURE_CLUSTER_NAME) --resource-group $(AZURE_RESOURCE_GROUP)