diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index 0c8c25dd..e736d117 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -16,6 +16,31 @@ spec: privileged: true runAsUser: 0 runAsGroup: 0 + env: + - name: KUBE_META_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: KUBE_META_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: KUBE_META_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: KUBE_META_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: KUBE_META_POD_UID + valueFrom: + fieldRef: + fieldPath: metadata.uid + - name: KUBE_META_OBJECT_NAME + valueFrom: + fieldRef: + fieldPath: metadata.labels['app.kubernetes.io/instance'] config: receivers: filelog: @@ -29,29 +54,26 @@ spec: parse_from: body parse_to: attributes processors: - k8sattributes: - auth_type: serviceAccount - wait_for_metadata: true - wait_for_metadata_timeout: 5s - passthrough: false - extract: - metadata: - - k8s.pod.name - - k8s.pod.ip - - k8s.pod.uid - - k8s.deployment.name - - k8s.deployment.uid - - k8s.namespace.name - - k8s.node.name - pod_association: - - sources: - - from: resource_attributes - name: k8s.pod.name - - sources: - - from: resource_attributes - name: k8s.pod.uid - - sources: - - from: connection + resource: + attributes: + - action: insert + key: k8s.node.name + from_env: KUBE_META_NODE_NAME + - action: insert + key: k8s.pod.name + from_env: KUBE_META_POD_NAME + - action: insert + key: k8s.pod.ip + from_env: KUBE_META_POD_IP + - action: insert + key: k8s.pod.uid + from_env: KUBE_META_POD_UID + - action: insert + key: k8s.namespace.name + from_env: KUBE_META_NAMESPACE + - action: insert + key: k8s.deployment.name + from_env: KUBE_META_OBJECT_NAME transform: log_statements: - context: log @@ -62,14 +84,12 @@ spec: - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - - set(resource.attributes["kubernetes_statefulset_name"], resource.attributes["k8s.statefulset.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) - set(log.body["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(log.body["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) - set(log.body["kubernetes"]["pod_ip"], resource.attributes["k8s.pod.ip"]) - set(log.body["kubernetes"]["pod_uid"], resource.attributes["k8s.pod.uid"]) - set(log.body["kubernetes"]["deployment"], resource.attributes["k8s.deployment.name"]) - - set(log.body["kubernetes"]["deployment_uid"], resource.attributes["k8s.deployment.uid"]) - set(log.body["kubernetes"]["node"], resource.attributes["k8s.node.name"]) - set(log.body["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) batch: @@ -89,6 +109,6 @@ spec: pipelines: logs: receivers: [filelog] - processors: [k8sattributes, transform, batch] + processors: [transform, batch] exporters: [otlphttp/logs, debug] {{- end }} \ No newline at end of file