From ba2a0973554b89e7e0783d9d02bcfff3c0d09092 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 16 Nov 2021 22:08:27 -0800 Subject: [PATCH 1/2] Make `clusterName` configuration parameter generally required --- CHANGELOG.md | 1 + README.md | 5 +++-- .../templates/config/_otel-agent.tpl | 4 +--- .../templates/config/_otel-collector.tpl | 8 -------- .../config/_otel-k8s-cluster-receiver-config.tpl | 4 +--- helm-charts/splunk-otel-collector/values.schema.json | 3 ++- helm-charts/splunk-otel-collector/values.yaml | 7 +++---- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 060927fb0..915a91f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ guidelines](https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UP - Extract `container.image.tag` attribute from `container.image.name` (#285) - Upgrade splunk-otel-collector image to 0.38.1 (#284) - Change secret names according to the GDI specification (#295) +- Make `clusterName` configuration parameter generally required (#296) ### Fixed diff --git a/README.md b/README.md index 47e0cd8f4..0efd46433 100644 --- a/README.md +++ b/README.md @@ -134,8 +134,9 @@ For Splunk Observability Cloud the following parameters are required: - `splunkObservability.realm`: Splunk realm to send telemetry data to. - `splunkObservability.accessToken`: Your Splunk Observability org access token. -- `clusterName`: arbitrary value that will identify your Kubernetes cluster in - Splunk Observability Cloud. + +The following parameter is required for any of the destinations: +- `clusterName`: arbitrary value that identifies your Kubernetes cluster. To deploy the chart to send data to Splunk Observability Cloud run the following commands replacing the parameters above with their appropriate values. 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 198609657..9f4287cf1 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl @@ -321,11 +321,9 @@ processors: - action: insert key: k8s.node.name value: "${K8S_NODE_NAME}" - {{- with .Values.clusterName }} - action: insert key: k8s.cluster.name - value: "{{ . }}" - {{- end }} + value: {{ .Values.clusterName }} {{- range .Values.extraAttributes.custom }} - action: insert key: "{{ .name }}" 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 ed32df3f0..78f1f8ac3 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-collector.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-collector.tpl @@ -97,13 +97,11 @@ processors: key: k8s.namespace.name value: "${K8S_NAMESPACE}" - {{ if or .Values.clusterName }} resource/add_cluster_name: attributes: - action: upsert value: {{ .Values.clusterName }} key: k8s.cluster.name - {{- end }} {{- if .Values.extraAttributes.custom }} resource/add_custom_attrs: @@ -169,9 +167,7 @@ service: - memory_limiter - batch - k8sattributes - {{- if .Values.clusterName }} - resource/add_cluster_name - {{- end }} {{- if .Values.extraAttributes.custom }} - resource/add_custom_attrs {{- end }} @@ -188,9 +184,7 @@ service: processors: - memory_limiter - batch - {{- if .Values.clusterName }} - resource/add_cluster_name - {{- end }} {{- if .Values.extraAttributes.custom }} - resource/add_custom_attrs {{- end }} @@ -237,9 +231,7 @@ service: processors: - memory_limiter - batch - {{- if .Values.clusterName }} - resource/add_cluster_name - {{- end }} - resource/add_collector_k8s - resourcedetection exporters: diff --git a/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl b/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl index 79e47165a..00313cc0d 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl @@ -84,11 +84,9 @@ processors: - action: insert key: receiver value: k8scluster - {{- with .Values.clusterName }} - action: upsert key: k8s.cluster.name - value: {{ . }} - {{- end }} + value: {{ .Values.clusterName }} {{- range .Values.extraAttributes.custom }} - action: upsert key: {{ .name }} diff --git a/helm-charts/splunk-otel-collector/values.schema.json b/helm-charts/splunk-otel-collector/values.schema.json index b6cbeaab7..dfeca3d26 100644 --- a/helm-charts/splunk-otel-collector/values.schema.json +++ b/helm-charts/splunk-otel-collector/values.schema.json @@ -19,7 +19,8 @@ }, "clusterName": { "description": "Cluster name that will be used as metadata attributes for all telemetry data", - "type": "string" + "type": "string", + "minLength": 1 }, "splunkPlatform": { "description": "Splunk Data-to-Everything Platform configuration", diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index c238aec17..8b4339b41 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -9,10 +9,9 @@ nameOverride: "" fullnameOverride: "" ################################################################################ -# clusterName is a REQUIRED field for Spunk Observability. It can be set to an -# arbitrary value that identifies this K8s cluster in SignalFx. The value will -# be associated with every trace, metric and log as "k8s.cluster.name" metadata -# attribute. +# clusterName is a REQUIRED. It can be set to an arbitrary value that identifies +# your K8s cluster. The value will be associated with every trace, metric and +# log as "k8s.cluster.name" attribute. ################################################################################ clusterName: "" From f1a68123732cd68bc0a413f4364293c53d2e19ee Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Wed, 17 Nov 2021 09:00:09 -0800 Subject: [PATCH 2/2] Update README.md Co-authored-by: Ryan Fitzpatrick --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0efd46433..dd7d062a9 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ For Splunk Observability Cloud the following parameters are required: token. The following parameter is required for any of the destinations: -- `clusterName`: arbitrary value that identifies your Kubernetes cluster. +- `clusterName`: arbitrary value that identifies your Kubernetes cluster. The value will be associated with every trace, metric and log as "k8s.cluster.name" attribute. To deploy the chart to send data to Splunk Observability Cloud run the following commands replacing the parameters above with their appropriate values.