From 5f1742e22ed53e3bba1a3b7b2b1f3e7d154bbb12 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Mon, 21 Apr 2025 16:42:28 +0800 Subject: [PATCH] refactor(opentelemetry): reorganize log transformation logic for clarity and consistency Signed-off-by: zhenyus --- .../authentication/opentelemetry.yaml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index 601a0308..de270e4e 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -66,17 +66,13 @@ spec: # - action: insert # key: kubernetes.node_name # from_attribute: k8s.node.name - - action: insert - key: app - from_attribute: context.app - - action: insert - key: environment - from_attribute: context.env - # transform: - # log_statements: - # - context: log - # statements: - # - set(log.body["kubernetes"], log.attributes["kubernetes"]) + transform: + log_statements: + - context: log + statements: + - set(log.body["kubernetes"], log.attributes["kubernetes"]) + - set(log.attributes["app"], log.attributes["context"].app) + - set(log.attributes["environment"], log.attributes["context"].env) batch: send_batch_size: 5 timeout: 10s