Skip to content

Added support for persistent buffering in receiver/gateway #1342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ The values can be overridden in .Values.clusterReceiver.config
extensions:
health_check:


{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
# k8s_observer w/ pod and node detection for eks/fargate deployment
k8s_observer:
Expand All @@ -16,6 +15,12 @@ extensions:
observe_nodes: true
{{- end }}

{{- if .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }}
file_storage/persistent_queue:
directory: {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver
timeout: 0
{{- end }}

receivers:
# Prometheus receiver scraping metrics from the pod itself
{{- include "splunk-otel-collector.prometheusInternalMetrics" "k8s-cluster-receiver" | nindent 2}}
Expand Down Expand Up @@ -190,6 +195,7 @@ exporters:
disable_compression: true
{{- end }}

{{- $_ := set . "addPersistentStorage" .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }}
{{- if (eq (include "splunk-otel-collector.platformMetricsEnabled" .) "true") }}
{{- include "splunk-otel-collector.splunkPlatformMetricsExporter" . | nindent 2 }}
{{- end }}
Expand All @@ -200,16 +206,20 @@ exporters:
sourcetype: kube:events
{{- end }}
{{- end }}
{{- $_ := unset . "addPersistentStorage" }}

service:
telemetry:
metrics:
address: 0.0.0.0:8889
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
extensions: [health_check, k8s_observer]
{{- else }}
extensions: [health_check]
{{- end }}
extensions:
- health_check
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
- k8s_observer
{{- end }}
{{- if .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }}
- file_storage/persistent_queue
{{- end }}
pipelines:
{{- if or (eq (include "splunk-otel-collector.o11yMetricsEnabled" $) "true") (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }}
# k8s metrics pipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ spec:
securityContext:
{{- include "splunk-otel-collector.securityContext" (dict "isWindows" .Values.isWindows "securityContext" $clusterReceiver.securityContext) | nindent 8 }}
{{- end }}
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
initContainers:
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
- name: cluster-receiver-node-discoverer
image: public.ecr.aws/amazonlinux/amazonlinux:latest
imagePullPolicy: IfNotPresent
Expand All @@ -104,7 +104,24 @@ spec:
mountPath: /splunk-messages
- mountPath: /conf
name: collector-configmap
{{- end }}
{{- end }}
{{- if .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }}
- name: patch-dirs
image: {{ template "splunk-otel-collector.image.initPatchLogDirs" . }}
imagePullPolicy: {{ .Values.image.initPatchLogDirs.pullPolicy }}
command: ['sh', '-c', '
mkdir -p {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver;
chown -Rv {{ $clusterReceiver.securityContext.runAsUser | default 999 }}:{{ $clusterReceiver.securityContext.runAsGroup | default 999 }} {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver;
chmod -v g+rwxs {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver;
setfacl -n -Rm d:m::rx,m::rx,d:g:{{ $clusterReceiver.securityContext.runAsGroup | default 999 }}:rx,g:{{ $clusterReceiver.securityContext.runAsGroup | default 999 }}:rx {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver;']
securityContext:
runAsUser: 0
Copy link
Contributor

@jvoravong jvoravong Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We probably need to document this runAsUser 0 and above used permissions in https://github.com/signalfx/splunk-otel-collector-chart/blob/main/docs/advanced-configuration.md#data-persistence as well as customer documentation. This would be done for the agent, cluster receiver, and gateway. A number of customers request information like this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest adding documentation primarily in the Advanced Configuration: Data Persistence section. Then, include a brief note with a hyperlink in the Running the Container in Non-Root User Mode section that points to the data persistence section.

resources:
{{- toYaml $clusterReceiver.resources | nindent 12 }}
volumeMounts:
- name: persistent-queue
mountPath: {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver
{{- end }}
containers:
- name: otel-collector
command:
Expand Down Expand Up @@ -189,6 +206,10 @@ spec:
mountPath: /otel/etc
readOnly: true
{{- end }}
{{- if .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }}
- name: persistent-queue
mountPath: {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver
{{- end }}
- mountPath: {{ .Values.isWindows | ternary "C:\\conf" "/conf" }}
name: collector-configmap
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
Expand Down Expand Up @@ -217,6 +238,12 @@ spec:
secret:
secretName: {{ template "splunk-otel-collector.secret" . }}
{{- end }}
{{- if .Values.splunkPlatform.sendingQueue.persistentQueue.enabled }}
- name: persistent-queue
hostPath:
path: {{ .Values.splunkPlatform.sendingQueue.persistentQueue.storagePath }}/clusterReceiver
type: DirectoryOrCreate
{{- end }}
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
- name: init-eks-fargate-cluster-receiver-script
configMap:
Expand Down