From 54ff0cb14470ab7f7e31eba5bee3fd23b256d9e8 Mon Sep 17 00:00:00 2001 From: Szilard Parrag Date: Fri, 26 Apr 2024 09:08:25 +0200 Subject: [PATCH 1/3] feat(conf gen): create dedicated receiver for each tenant Signed-off-by: Szilard Parrag --- .../otel_col_conf_test_fixtures/complex.yaml | 179 ++++++++++++++---- .../controller/telemetry/otel_conf_gen.go | 49 +++-- .../telemetry/otel_conf_gen_test.go | 135 +++++++++---- 3 files changed, 269 insertions(+), 94 deletions(-) diff --git a/internal/controller/telemetry/otel_col_conf_test_fixtures/complex.yaml b/internal/controller/telemetry/otel_col_conf_test_fixtures/complex.yaml index 29d8d4c2..9942273d 100644 --- a/internal/controller/telemetry/otel_col_conf_test_fixtures/complex.yaml +++ b/internal/controller/telemetry/otel_col_conf_test_fixtures/complex.yaml @@ -1,5 +1,5 @@ receivers: - filelog/kubernetes: + filelog/example-tenant-a: exclude: - /var/log/pods/*/otc-container/*.log include: @@ -54,25 +54,86 @@ receivers: - from: attributes.uid to: resource["k8s.pod.uid"] type: move + retry_on_failure: + enabled: true + max_elapsed_time: 0 + start_at: end + filelog/example-tenant-b: + exclude: + - /var/log/pods/*/otc-container/*.log + include: + - /var/log/pods/*/*/*.log + include_file_name: false + include_file_path: true + operators: + - id: get-format + routes: + - expr: body matches "^\\{" + output: parser-docker + - expr: body matches "^[^ Z]+Z" + output: parser-containerd + type: router + - id: parser-containerd + output: extract_metadata_from_filepath + regex: ^(?P