From 802698bcb7b91eee79f22cbc4272c1310137dd95 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 22 Sep 2025 21:21:19 +0800 Subject: [PATCH] fix: align authentication logging with chat service configuration - Add parse_to: attributes to json_parser operator - Add move operator to move text content to body - Use application instead of service_name for consistency - Use global.environment for environment setting - Add global.environment to values files for both alpha and prod - This should fix the unknown_service classification issue --- .../templates/authentication/opentelemetry.yaml | 9 ++++++--- freeleaps/helm-pkg/authentication/values.alpha.yaml | 2 ++ freeleaps/helm-pkg/authentication/values.prod.yaml | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index 53489b58..fd330a40 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -52,6 +52,10 @@ spec: operators: - type: json_parser parse_from: body + parse_to: attributes + - type: move + from: attributes.text + to: body processors: resource: attributes: @@ -77,9 +81,8 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["service.name"], "authentication") - - set(resource.attributes["service_name"], "authentication") - - set(resource.attributes["environment"], "alpha") + - set(resource.attributes["application"], "authentication") + - set(resource.attributes["environment"], "{{ .Values.global.environment | default .Release.Namespace }}") - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) diff --git a/freeleaps/helm-pkg/authentication/values.alpha.yaml b/freeleaps/helm-pkg/authentication/values.alpha.yaml index 239fe4e7..911554c0 100644 --- a/freeleaps/helm-pkg/authentication/values.alpha.yaml +++ b/freeleaps/helm-pkg/authentication/values.alpha.yaml @@ -9,6 +9,8 @@ logIngest: lokiEndpoint: http://loki-gateway.freeleaps-logging-system logPathPattern: /app/log/authentication/*.log logPath: /app/log/authentication +global: + environment: alpha authentication: replicas: 1 image: diff --git a/freeleaps/helm-pkg/authentication/values.prod.yaml b/freeleaps/helm-pkg/authentication/values.prod.yaml index f18ddc1e..b8807e6b 100644 --- a/freeleaps/helm-pkg/authentication/values.prod.yaml +++ b/freeleaps/helm-pkg/authentication/values.prod.yaml @@ -12,6 +12,8 @@ logIngest: lokiEndpoint: http://loki-gateway.freeleaps-logging-system logPathPattern: /app/log/authentication/*.log logPath: /app/log/authentication +global: + environment: prod authentication: replicas: 1 image: