From 8b25b8e6884b5c1f27f12817895399dcb2a78887 Mon Sep 17 00:00:00 2001 From: chaitanyaphalak Date: Thu, 28 Oct 2021 15:15:34 -0700 Subject: [PATCH 1/5] Add index routing --- .../splunk-otel-collector/templates/config/_otel-agent.tpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl b/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl index b00cd82804..efcdc10430 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl @@ -276,6 +276,12 @@ processors: - key: splunk.com/exclude tag_name: splunk.com/exclude from: pod + - key: splunk.com/index + tag_name: com.splunk.index + from: namespace + - key: splunk.com/index + tag_name: com.splunk.index + from: pod {{- with .Values.extraAttributes.podLabels }} labels: {{- range . }} From 2e7af2e524b42c64f1808dfd8ea3f9cf653e7afa Mon Sep 17 00:00:00 2001 From: chaitanyaphalak Date: Thu, 28 Oct 2021 15:19:23 -0700 Subject: [PATCH 2/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3791ad2845..57295308f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Add initContainer for log checkpoint migration from Fluentd to Otel agent (#253) +- Add index routing for splunk customers.(#256) ## [0.37.0] - 2021-10-26 From a3b3d0b8eaa8973c86a81b5c77ad57290e52dfb7 Mon Sep 17 00:00:00 2001 From: chaitanyaphalak Date: Thu, 28 Oct 2021 17:02:43 -0700 Subject: [PATCH 3/5] add rendered files --- rendered/manifests/agent-only/configmap-otel-agent.yaml | 6 ++++++ rendered/manifests/agent-only/daemonset.yaml | 2 +- rendered/manifests/logs-only/configmap-otel-agent.yaml | 6 ++++++ rendered/manifests/logs-only/daemonset.yaml | 2 +- rendered/manifests/metrics-only/configmap-otel-agent.yaml | 6 ++++++ rendered/manifests/metrics-only/daemonset.yaml | 2 +- rendered/manifests/traces-only/configmap-otel-agent.yaml | 6 ++++++ rendered/manifests/traces-only/daemonset.yaml | 2 +- 8 files changed, 28 insertions(+), 4 deletions(-) diff --git a/rendered/manifests/agent-only/configmap-otel-agent.yaml b/rendered/manifests/agent-only/configmap-otel-agent.yaml index f3d635e9a0..8066ce7585 100644 --- a/rendered/manifests/agent-only/configmap-otel-agent.yaml +++ b/rendered/manifests/agent-only/configmap-otel-agent.yaml @@ -67,6 +67,12 @@ data: - from: pod key: splunk.com/exclude tag_name: splunk.com/exclude + - from: namespace + key: splunk.com/index + tag_name: com.splunk.index + - from: pod + key: splunk.com/index + tag_name: com.splunk.index labels: - key: app metadata: diff --git a/rendered/manifests/agent-only/daemonset.yaml b/rendered/manifests/agent-only/daemonset.yaml index db5900b568..4db2501277 100644 --- a/rendered/manifests/agent-only/daemonset.yaml +++ b/rendered/manifests/agent-only/daemonset.yaml @@ -28,7 +28,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: 4ffcd6ad374bf3453a1bbfb00e3e479e5a7cf02fccda7ff775f910c4a5bbd14b + checksum/config: 20a1fd3f41ceed15707bd33502fd3f75ce1597d18af73ce912f4f439897ce980 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true diff --git a/rendered/manifests/logs-only/configmap-otel-agent.yaml b/rendered/manifests/logs-only/configmap-otel-agent.yaml index 5d4face781..31e1e2990e 100644 --- a/rendered/manifests/logs-only/configmap-otel-agent.yaml +++ b/rendered/manifests/logs-only/configmap-otel-agent.yaml @@ -64,6 +64,12 @@ data: - from: pod key: splunk.com/exclude tag_name: splunk.com/exclude + - from: namespace + key: splunk.com/index + tag_name: com.splunk.index + - from: pod + key: splunk.com/index + tag_name: com.splunk.index labels: - key: app metadata: diff --git a/rendered/manifests/logs-only/daemonset.yaml b/rendered/manifests/logs-only/daemonset.yaml index 41eda12ffd..48e8fdca9c 100644 --- a/rendered/manifests/logs-only/daemonset.yaml +++ b/rendered/manifests/logs-only/daemonset.yaml @@ -28,7 +28,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: 4328d5df45de1880b436838f5094a78a57b3bb464a6615053a5569acf2b963fb + checksum/config: 983ef6fe97ebf7e114e7702c2bbd0ba72194b668994a283d9fccef9bc9f559c9 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true diff --git a/rendered/manifests/metrics-only/configmap-otel-agent.yaml b/rendered/manifests/metrics-only/configmap-otel-agent.yaml index cef4dbc812..a8d0f86634 100644 --- a/rendered/manifests/metrics-only/configmap-otel-agent.yaml +++ b/rendered/manifests/metrics-only/configmap-otel-agent.yaml @@ -61,6 +61,12 @@ data: - from: pod key: splunk.com/exclude tag_name: splunk.com/exclude + - from: namespace + key: splunk.com/index + tag_name: com.splunk.index + - from: pod + key: splunk.com/index + tag_name: com.splunk.index labels: - key: app metadata: diff --git a/rendered/manifests/metrics-only/daemonset.yaml b/rendered/manifests/metrics-only/daemonset.yaml index 35f93bdfa6..9622be8b81 100644 --- a/rendered/manifests/metrics-only/daemonset.yaml +++ b/rendered/manifests/metrics-only/daemonset.yaml @@ -27,7 +27,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: 9c3e9e1d077cd5b6a4bbdf19c15b2a819cfeb0403e4d6c7e67f71d401b25df79 + checksum/config: 8c07d464239d90650b529646b44d241718a1dea4767be5c805ebde25e5b8ea42 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true diff --git a/rendered/manifests/traces-only/configmap-otel-agent.yaml b/rendered/manifests/traces-only/configmap-otel-agent.yaml index ef9dfe453c..f9753e58bc 100644 --- a/rendered/manifests/traces-only/configmap-otel-agent.yaml +++ b/rendered/manifests/traces-only/configmap-otel-agent.yaml @@ -64,6 +64,12 @@ data: - from: pod key: splunk.com/exclude tag_name: splunk.com/exclude + - from: namespace + key: splunk.com/index + tag_name: com.splunk.index + - from: pod + key: splunk.com/index + tag_name: com.splunk.index labels: - key: app metadata: diff --git a/rendered/manifests/traces-only/daemonset.yaml b/rendered/manifests/traces-only/daemonset.yaml index 55385fadf4..9f605e92a1 100644 --- a/rendered/manifests/traces-only/daemonset.yaml +++ b/rendered/manifests/traces-only/daemonset.yaml @@ -27,7 +27,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: f13bd43848f30b76fe54b1069cc94749703ae49e278d4f875281d1f6ea85d8f0 + checksum/config: bdfe44006ba069e4375ed1dda455e6e3ce606f9cbbe0b1492c2a51706e12eb31 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true From d02ae21696c005fcd750efad9ccb5e26cf39d294 Mon Sep 17 00:00:00 2001 From: chaitanyaphalak Date: Thu, 28 Oct 2021 17:04:42 -0700 Subject: [PATCH 4/5] fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57295308f6..af3f4b9600 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Add initContainer for log checkpoint migration from Fluentd to Otel agent (#253) -- Add index routing for splunk customers.(#256) +- Add index routing for Splunk Enterprise/Cloud customers (#256) ## [0.37.0] - 2021-10-26 From f63242395c999a4b91ccbd7f1ed1a500c78dad0e Mon Sep 17 00:00:00 2001 From: chaitanyaphalak Date: Thu, 28 Oct 2021 17:19:09 -0700 Subject: [PATCH 5/5] add implementation for gateway collector --- .../templates/config/_otel-collector.tpl | 6 ++++++ .../manifests/gateway-only/configmap-otel-collector.yaml | 6 ++++++ rendered/manifests/gateway-only/deployment-collector.yaml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/helm-charts/splunk-otel-collector/templates/config/_otel-collector.tpl b/helm-charts/splunk-otel-collector/templates/config/_otel-collector.tpl index c02006e097..46c59ada47 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-collector.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-collector.tpl @@ -59,6 +59,12 @@ processors: - key: splunk.com/exclude tag_name: splunk.com/exclude from: pod + - key: splunk.com/index + tag_name: com.splunk.index + from: namespace + - key: splunk.com/index + tag_name: com.splunk.index + from: pod {{- with .Values.extraAttributes.podLabels }} labels: {{- range . }} diff --git a/rendered/manifests/gateway-only/configmap-otel-collector.yaml b/rendered/manifests/gateway-only/configmap-otel-collector.yaml index db274066ba..3e31f1b85f 100644 --- a/rendered/manifests/gateway-only/configmap-otel-collector.yaml +++ b/rendered/manifests/gateway-only/configmap-otel-collector.yaml @@ -54,6 +54,12 @@ data: - from: pod key: splunk.com/exclude tag_name: splunk.com/exclude + - from: namespace + key: splunk.com/index + tag_name: com.splunk.index + - from: pod + key: splunk.com/index + tag_name: com.splunk.index labels: - key: app metadata: diff --git a/rendered/manifests/gateway-only/deployment-collector.yaml b/rendered/manifests/gateway-only/deployment-collector.yaml index bdb9721186..40e532c4e1 100644 --- a/rendered/manifests/gateway-only/deployment-collector.yaml +++ b/rendered/manifests/gateway-only/deployment-collector.yaml @@ -30,7 +30,7 @@ spec: component: otel-collector release: default annotations: - checksum/config: 2963fe3886378456d19ca16255af597ead8a8107b61963c01031eed94a136639 + checksum/config: 6ddfa38dbe4dd50fd0ff81ab32a4119f9f886f0477d838bfdc89ae6af06dbd16 spec: serviceAccountName: default-splunk-otel-collector nodeSelector: