diff --git a/.changelog/3796.fixed.txt b/.changelog/3796.fixed.txt new file mode 100644 index 0000000000..adf9198db7 --- /dev/null +++ b/.changelog/3796.fixed.txt @@ -0,0 +1 @@ +fix(logs): do not add exporters mutliple times to the pipeline \ No newline at end of file diff --git a/deploy/helm/sumologic/templates/_helpers/_logs.tpl b/deploy/helm/sumologic/templates/_helpers/_logs.tpl index c67fec66df..26ad92db7d 100644 --- a/deploy/helm/sumologic/templates/_helpers/_logs.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_logs.tpl @@ -127,6 +127,7 @@ Return all exporters for .Type pipeline {{- $exporters = append $exporters $exporter -}} {{- end -}} {{- end -}} +{{- $exporters = uniq $exporters -}} {{- range $_, $exporter := $exporters }} {{ printf "- %s" $exporter }} {{- end }} diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.input.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.input.yaml index 6cdf0ddce3..6df29369bc 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.input.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.input.yaml @@ -13,6 +13,7 @@ sumologic: routing: fallbackExporters: - debug + - sumologic/test table: - exporter: sumologic/test statement: route() where resource.attributes["exporter"] == "test" diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.output.yaml index eb9a92c03a..3133052e2a 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.output.yaml @@ -221,6 +221,7 @@ data: routing/containers: default_exporters: - debug + - sumologic/test table: - exporters: - sumologic/test @@ -228,6 +229,7 @@ data: routing/systemd: default_exporters: - debug + - sumologic/test table: - exporters: - sumologic/test