From b7b32464ecd9851ec21856d43b92add121f875ff Mon Sep 17 00:00:00 2001 From: Szymon Bylica <142112966+sbylica-splunk@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:45:18 +0200 Subject: [PATCH] Added fsyncEnabled option to values.yaml (#1425) --- .chloggen/addfsyncflagconfig.yaml | 8 ++++++++ .../templates/config/_otel-agent.tpl | 6 ++++++ helm-charts/splunk-otel-collector/values.schema.json | 3 +++ helm-charts/splunk-otel-collector/values.yaml | 5 +++++ 4 files changed, 22 insertions(+) create mode 100644 .chloggen/addfsyncflagconfig.yaml diff --git a/.chloggen/addfsyncflagconfig.yaml b/.chloggen/addfsyncflagconfig.yaml new file mode 100644 index 0000000000..bbcdbaf097 --- /dev/null +++ b/.chloggen/addfsyncflagconfig.yaml @@ -0,0 +1,8 @@ +# 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: agent +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Added `fsyncFlag` configuration to allow users to enable fsync on the filestorage. +# One or more tracking issues related to the change +issues: [1425] 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 14db322489..710c37a713 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl @@ -9,12 +9,18 @@ extensions: {{- if and (eq (include "splunk-otel-collector.logsEnabled" .) "true") (eq .Values.logsEngine "otel") }} file_storage: directory: {{ .Values.logsCollection.checkpointPath }} + {{- if not (eq (toString .Values.splunkPlatform.fsyncEnabled) "") }} + fsync: {{ .Values.splunkPlatform.fsyncEnabled }} + {{- end }} {{- end }} {{- if .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }} file_storage/persistent_queue: directory: {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/agent timeout: 0 + {{- if not (eq (toString .Values.splunkPlatform.fsyncEnabled) "") }} + fsync: {{ .Values.splunkPlatform.fsyncEnabled }} + {{- end }} {{- end }} diff --git a/helm-charts/splunk-otel-collector/values.schema.json b/helm-charts/splunk-otel-collector/values.schema.json index 66880e0252..6472c986a7 100644 --- a/helm-charts/splunk-otel-collector/values.schema.json +++ b/helm-charts/splunk-otel-collector/values.schema.json @@ -154,6 +154,9 @@ } } } + }, + "fsyncEnabled": { + "type": "boolean" } }, "anyOf": [ diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index 71390de2f0..4f7d94ff76 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -121,6 +121,11 @@ splunkPlatform: enabled: false storagePath: "/var/addon/splunk/exporter_queue" + # Option to set fsync value for filestorage extension used by the agent. Enabling this option will ensure + # database integrity at the cost of performance. If not set it will use default value for this extension. + # Refer to: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/storage/filestorage#file-storage + # fsyncEnabled: true + ################################################################################ # Splunk Observability configuration ################################################################################