From d38c580556cd41086a8553b8e9a34fa91fba4195 Mon Sep 17 00:00:00 2001 From: Vibhu Pandey Date: Thu, 19 Sep 2024 19:41:02 +0530 Subject: [PATCH] fix(k8s-infra): enable k8sattributes to match other information (#488) ## Summary #### **New Features** - Introduced a new `k8snode` detector to add k8s.node.uid for hostmetrics. - Updated logging configuration to the new streamlined container parser for better maintainability. #### **Fixes** - The removal of k8s.pod.uid and k8s.pod.ip attributes and the inclusion of k8s.node.name attribute instead should resolve the interference issue with the k8sprocessor and improve its ability to match and enrich telemetry data accurately. #### **Chores** - Incremented Helm chart version and OpenTelemetry collector image version for new features and improvements. --- charts/k8s-infra/Chart.yaml | 4 +- charts/k8s-infra/templates/_config.tpl | 4 + .../templates/otel-agent/daemonset.yaml | 2 +- charts/k8s-infra/values.yaml | 95 ++----------------- 4 files changed, 17 insertions(+), 88 deletions(-) diff --git a/charts/k8s-infra/Chart.yaml b/charts/k8s-infra/Chart.yaml index 03e3fe2b..6aa9841f 100644 --- a/charts/k8s-infra/Chart.yaml +++ b/charts/k8s-infra/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: k8s-infra description: Helm chart for collecting metrics and logs in K8s type: application -version: 0.11.11 -appVersion: "0.88.0" +version: 0.11.12 +appVersion: "0.109.0" home: https://signoz.io icon: https://signoz.io/img/SigNozLogo-orange.svg keywords: diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index 20fc1076..6a7dbec1 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -364,6 +364,10 @@ processors: resourcedetection/internal: detectors: - env + - k8snode + k8snode: + node_from_env_var: K8S_NODE_NAME + auth_type: serviceAccount timeout: {{ .Values.presets.resourceDetectionInternal.timeout }} override: {{ .Values.presets.resourceDetectionInternal.override }} {{- end }} diff --git a/charts/k8s-infra/templates/otel-agent/daemonset.yaml b/charts/k8s-infra/templates/otel-agent/daemonset.yaml index c53f5aa6..35ad201c 100644 --- a/charts/k8s-infra/templates/otel-agent/daemonset.yaml +++ b/charts/k8s-infra/templates/otel-agent/daemonset.yaml @@ -99,7 +99,7 @@ spec: - name: SIGNOZ_COMPONENT value: {{ default "otel-agent" .Values.otelAgent.name }} - name: OTEL_RESOURCE_ATTRIBUTES - {{- $attribs := "signoz.component=$(SIGNOZ_COMPONENT),k8s.cluster.name=$(K8S_CLUSTER_NAME),k8s.pod.uid=$(K8S_POD_UID),k8s.pod.ip=$(K8S_POD_IP)" }} + {{- $attribs := "signoz.component=$(SIGNOZ_COMPONENT),k8s.cluster.name=$(K8S_CLUSTER_NAME),k8s.node.name=$(K8S_NODE_NAME)" }} {{- if .Values.presets.resourceDetection.envResourceAttributes }} {{- $attribs = printf "%s,%s" $attribs .Values.presets.resourceDetection.envResourceAttributes }} {{- end }} diff --git a/charts/k8s-infra/values.yaml b/charts/k8s-infra/values.yaml index 67021893..bfaa427b 100644 --- a/charts/k8s-infra/values.yaml +++ b/charts/k8s-infra/values.yaml @@ -123,88 +123,8 @@ presets: containers: [] additionalInclude: [] operators: - # Find out which format is used by kubernetes - - type: router - id: get-format - routes: - - output: parser-docker - expr: 'body matches "^\\{"' - - output: parser-crio - expr: 'body matches "^[^ Z]+ "' - - output: parser-containerd - expr: 'body matches "^[^ Z]+Z"' - # Parse CRI-O format - - type: regex_parser - id: parser-crio - regex: '^(?P