diff --git a/charts/opentelemetry-collector-0.1.0.tgz b/charts/opentelemetry-collector-0.1.0.tgz new file mode 100644 index 0000000..894d606 Binary files /dev/null and b/charts/opentelemetry-collector-0.1.0.tgz differ diff --git a/charts/sck-otel/templates/_config.tpl b/charts/sck-otel/templates/_config.tpl index c0d8188..5d120ff 100644 --- a/charts/sck-otel/templates/_config.tpl +++ b/charts/sck-otel/templates/_config.tpl @@ -223,11 +223,13 @@ processors: name: k8s.pod.uid extract: metadata: - - deployment - - cluster - - namespace - - node - - startTime + - k8s.pod.name + - k8s.pod.uid + - k8s.deployment.name + - k8s.cluster.name + - k8s.namespace.name + - k8s.node.name + - k8s.pod.start_time annotations: {{- toYaml .Values.containers.listOfAnnotations | nindent 8 }} labels: diff --git a/charts/sck-otel/values.yaml b/charts/sck-otel/values.yaml index e5db91d..2acde22 100644 --- a/charts/sck-otel/values.yaml +++ b/charts/sck-otel/values.yaml @@ -61,8 +61,15 @@ containers: # List of annotation and label fields to enrich with listOfAnnotations: - key: splunk.com/index + from: pod - key: splunk.com/sourcetype + from: pod - key: splunk.com/exclude + from: pod + - key: splunk.com/index + from: namespace + - key: splunk.com/exclude + from: namespace listOfLabels: - key: app multilineSupportConfig: [] diff --git a/ci_scripts/sck_otel_values.yaml b/ci_scripts/sck_otel_values.yaml index 191e9cd..af18f79 100644 --- a/ci_scripts/sck_otel_values.yaml +++ b/ci_scripts/sck_otel_values.yaml @@ -61,9 +61,18 @@ containers: - key: splunk.com/exclude - key: splunk.com/customField tag_name: customField + - key: splunk.com/index + from: namespace + - key: splunk.com/exclude + from: namespace + - key: splunk.com/customField + tag_name: customField + from: namespace listOfLabels: - key: app - + from: pod + - key: app + from: namespace customMetadata: cluster_name: ci-k8s-cluster customfield1: customvalue1 diff --git a/test/k8s_logging_tests/test_config_logging.py b/test/k8s_logging_tests/test_config_logging.py index ffb72d2..a1d7a5e 100644 --- a/test/k8s_logging_tests/test_config_logging.py +++ b/test/k8s_logging_tests/test_config_logging.py @@ -42,7 +42,7 @@ def test_splunk_index(setup, test_input, expected): @pytest.mark.parametrize("label,index,expected", [ ("pod-w-index-wo-ns-index", "pod-anno", 1), - #("pod-wo-index-w-ns-index", "ns-anno", 1), + ("pod-wo-index-w-ns-index", "ns-anno", 1), ("pod-w-index-w-ns-index", "pod-anno", 1) ]) def test_label_collection(setup, label, index, expected): @@ -65,7 +65,7 @@ def test_label_collection(setup, label, index, expected): @pytest.mark.parametrize("container_name,expected", [ ("pod-w-index-w-ns-index", 1), - #("pod-wo-index-w-ns-index", 1), + ("pod-wo-index-w-ns-index", 1), ("pod-w-index-wo-ns-index", 1), ("pod-wo-index-wo-ns-index", 1), ]) @@ -252,7 +252,7 @@ def test_custom_metadata_fields(setup, field,value, expected): @pytest.mark.parametrize("label,index,value,expected", [ ("pod-w-index-wo-ns-index", "pod-anno", "pod-value-2", 1), - #("pod-wo-index-w-ns-index", "ns-anno", "ns-value", 1), + ("pod-wo-index-w-ns-index", "ns-anno", "ns-value", 1), ("pod-w-index-w-ns-index", "pod-anno", "pod-value-1", 1) ]) def test_custom_metadata_fields_annotations(setup, label, index, value, expected):