From 7a4171a2849a7a64fefa4f4176c017a051ad1d8a Mon Sep 17 00:00:00 2001 From: Enrico Giorio <162458291+obs-gh-enricogiorio@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:13:44 +0100 Subject: [PATCH] fix: Swap transform/object and observek8sattributes processors (#255) The observek8sattributes processor might edit the log body in-place, which might affect the value of facets computed by transform/object. Therefore, we swap the two processors in the pipeline to make sure observek8sattributes always acts before transform/object. --- charts/agent/Chart.yaml | 2 +- charts/agent/README.md | 2 +- charts/agent/templates/_cluster-events-config.tpl | 2 +- charts/agent/templates/_config-processors.tpl | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/agent/Chart.yaml b/charts/agent/Chart.yaml index 65a5c37b..25ba1620 100644 --- a/charts/agent/Chart.yaml +++ b/charts/agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: agent description: Chart to install K8s collection stack based on Observe Agent type: application -version: 0.30.3 +version: 0.30.4 appVersion: "1.1.0" dependencies: - name: opentelemetry-collector diff --git a/charts/agent/README.md b/charts/agent/README.md index 44b0cb0f..9e257865 100644 --- a/charts/agent/README.md +++ b/charts/agent/README.md @@ -1,6 +1,6 @@ # agent -![Version: 0.30.3](https://img.shields.io/badge/Version-0.30.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) +![Version: 0.30.4](https://img.shields.io/badge/Version-0.30.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) > [!CAUTION] > This chart is under active development and is not meant to be installed yet. diff --git a/charts/agent/templates/_cluster-events-config.tpl b/charts/agent/templates/_cluster-events-config.tpl index 8da1ed19..055c788e 100644 --- a/charts/agent/templates/_cluster-events-config.tpl +++ b/charts/agent/templates/_cluster-events-config.tpl @@ -429,7 +429,7 @@ service: pipelines: logs/objects: receivers: [k8sobjects/objects] - processors: [memory_limiter, batch, resource/observe_common, transform/object, observek8sattributes] + processors: [memory_limiter, batch, resource/observe_common, observek8sattributes, transform/object] exporters: [otlphttp/observe/entity, debug/override] logs/cluster: receivers: [k8sobjects/cluster] diff --git a/charts/agent/templates/_config-processors.tpl b/charts/agent/templates/_config-processors.tpl index f88d4d00..937880ec 100644 --- a/charts/agent/templates/_config-processors.tpl +++ b/charts/agent/templates/_config-processors.tpl @@ -82,7 +82,8 @@ memory_limiter: spike_limit_percentage: 25 {{- end -}} +# This processor might edit the log body in-place, which might affect the output of transform/object. +# Therefore, this processor must always be placed before transform/object in the pipeline. {{- define "config.processors.attributes.observek8sattributes" -}} -# needs to come after transform/watch_objects in pipelines observek8sattributes: {{- end -}}