From c76617ff11b75ad954f4238ed71e2e496dfdaa3b Mon Sep 17 00:00:00 2001 From: mstopa-splunk <139441697+mstopa-splunk@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:44:20 +0200 Subject: [PATCH] Add metricsSourceType tracesSourceType (#1376) * Add metricsSourceType and tracesSourceType in values.yaml * Add .chloggen * Propagate sourcetype to metrics and traces * Revert changes in values.schema.json * Add issue number .chloggen --------- Co-authored-by: jvoravong <47871238+jvoravong@users.noreply.github.com> --- .chloggen/addmetricsSourceTypetracesSourceType.yaml | 12 ++++++++++++ .../templates/config/_common.tpl | 6 ++++++ helm-charts/splunk-otel-collector/values.yaml | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .chloggen/addmetricsSourceTypetracesSourceType.yaml diff --git a/.chloggen/addmetricsSourceTypetracesSourceType.yaml b/.chloggen/addmetricsSourceTypetracesSourceType.yaml new file mode 100644 index 000000000..5ad9ae99e --- /dev/null +++ b/.chloggen/addmetricsSourceTypetracesSourceType.yaml @@ -0,0 +1,12 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement +# The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other) +component: chart +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Propagated "sourcetype" to work for metrics and traces +# One or more tracking issues related to the change +issues: [1376] +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/helm-charts/splunk-otel-collector/templates/config/_common.tpl b/helm-charts/splunk-otel-collector/templates/config/_common.tpl index 93f3b39b7..7917f5d48 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_common.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_common.tpl @@ -403,6 +403,9 @@ splunk_hec/platform_metrics: token: "${SPLUNK_PLATFORM_HEC_TOKEN}" index: {{ .Values.splunkPlatform.metricsIndex | quote }} source: {{ .Values.splunkPlatform.source | quote }} + {{- if .Values.splunkPlatform.sourcetype }} + sourcetype: {{ .Values.splunkPlatform.sourcetype | quote }} + {{- end }} max_idle_conns: {{ .Values.splunkPlatform.maxConnections }} max_idle_conns_per_host: {{ .Values.splunkPlatform.maxConnections }} disable_compression: {{ .Values.splunkPlatform.disableCompression }} @@ -444,6 +447,9 @@ splunk_hec/platform_traces: token: "${SPLUNK_PLATFORM_HEC_TOKEN}" index: {{ .Values.splunkPlatform.tracesIndex | quote }} source: {{ .Values.splunkPlatform.source | quote }} + {{- if .Values.splunkPlatform.sourcetype }} + sourcetype: {{ .Values.splunkPlatform.sourcetype | quote }} + {{- end }} max_idle_conns: {{ .Values.splunkPlatform.maxConnections }} max_idle_conns_per_host: {{ .Values.splunkPlatform.maxConnections }} disable_compression: {{ .Values.splunkPlatform.disableCompression }} diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index ed4078f76..3a46324d1 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -47,7 +47,7 @@ splunkPlatform: # Optional. Default value for `source` field. source: "kubernetes" # Optional. Default value for `sourcetype` field. For container logs, it will - # be container name. + # be container name. For metrics and traces it will default to "httpevent". sourcetype: "" # Maximum HTTP connections to use simultaneously when sending data. maxConnections: 200