Skip to content

Commit dbc12ae

Browse files
committed
Add batch processor preset
1 parent ac6f2c2 commit dbc12ae

5 files changed

Lines changed: 61 additions & 1 deletion

File tree

charts/opentelemetry-collector/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## OpenTelemetry Collector
44

5+
## v0.115.2 / 2025-05-22
6+
- [Feat] Add batch processor preset
7+
58
## v0.115.1 / 2025-05-19
69
- [Update] `kubeletstatsreceiver`: set `collect_all_network_interfaces` on `pods`
710

charts/opentelemetry-collector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: opentelemetry-collector
3-
version: 0.115.1
3+
version: 0.115.2
44
description: OpenTelemetry Collector Helm chart for Kubernetes
55
type: application
66
home: https://opentelemetry.io/

charts/opentelemetry-collector/templates/_config.tpl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ Build config file for daemonset OpenTelemetry Collector
112112
{{- if .Values.presets.zipkinReceiver.enabled }}
113113
{{- $config = (include "opentelemetry-collector.applyZipkinReceiverConfig" (dict "Values" $data "config" $config) | fromYaml) }}
114114
{{- end }}
115+
{{- if .Values.presets.batch.enabled }}
116+
{{- $config = (include "opentelemetry-collector.applyBatchProcessorConfig" (dict "Values" $data "config" $config) | fromYaml) }}
117+
{{- end }}
115118
{{- $config = (include "opentelemetry-collector.applyBatchProcessorAsLast" (dict "Values" $data "config" $config) | fromYaml) }}
116119
{{- tpl (toYaml $config) . }}
117120
{{- end }}
@@ -192,6 +195,9 @@ Build config file for deployment OpenTelemetry Collector
192195
{{- if .Values.presets.zipkinReceiver.enabled }}
193196
{{- $config = (include "opentelemetry-collector.applyZipkinReceiverConfig" (dict "Values" $data "config" $config) | fromYaml) }}
194197
{{- end }}
198+
{{- if .Values.presets.batch.enabled }}
199+
{{- $config = (include "opentelemetry-collector.applyBatchProcessorConfig" (dict "Values" $data "config" $config) | fromYaml) }}
200+
{{- end }}
195201
{{- $config = (include "opentelemetry-collector.applyBatchProcessorAsLast" (dict "Values" $data "config" $config) | fromYaml) }}
196202
{{- $config = (include "opentelemetry-collector.applyMemoryLimiterProcessorAsFirst" (dict "Values" $data "config" $config) | fromYaml) }}
197203
{{- tpl (toYaml $config) . }}
@@ -1784,3 +1790,25 @@ receivers:
17841790
zipkin:
17851791
endpoint: ${env:MY_POD_IP}:9411
17861792
{{- end }}
1793+
1794+
{{- define "opentelemetry-collector.applyBatchProcessorConfig" -}}
1795+
{{- $config := mustMergeOverwrite (include "opentelemetry-collector.batchProcessorConfig" .Values | fromYaml) .config }}
1796+
{{- if and ($config.service.pipelines.logs) (not (has "batch" $config.service.pipelines.logs.processors)) }}
1797+
{{- $_ := set $config.service.pipelines.logs "processors" (append $config.service.pipelines.logs.processors "batch" | uniq) }}
1798+
{{- end }}
1799+
{{- if and ($config.service.pipelines.metrics) (not (has "batch" $config.service.pipelines.metrics.processors)) }}
1800+
{{- $_ := set $config.service.pipelines.metrics "processors" (append $config.service.pipelines.metrics.processors "batch" | uniq) }}
1801+
{{- end }}
1802+
{{- if and ($config.service.pipelines.traces) (not (has "batch" $config.service.pipelines.traces.processors)) }}
1803+
{{- $_ := set $config.service.pipelines.traces "processors" (append $config.service.pipelines.traces.processors "batch" | uniq) }}
1804+
{{- end }}
1805+
{{- $config | toYaml }}
1806+
{{- end }}
1807+
1808+
{{- define "opentelemetry-collector.batchProcessorConfig" -}}
1809+
processors:
1810+
batch:
1811+
send_batch_size: {{ .Values.presets.batch.sendBatchSize }}
1812+
send_batch_max_size: {{ .Values.presets.batch.sendBatchMaxSize }}
1813+
timeout: {{ .Values.presets.batch.timeout }}
1814+
{{- end }}

charts/opentelemetry-collector/values.schema.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,28 @@
855855
"type": "boolean"
856856
}
857857
}
858+
},
859+
"batch": {
860+
"type": "object",
861+
"additionalProperties": false,
862+
"properties": {
863+
"enabled": {
864+
"description": "Specifies whether the batch processor preset is applied.",
865+
"type": "boolean"
866+
},
867+
"sendBatchSize": {
868+
"description": "Specifies the send_batch_size for the batch processor.",
869+
"type": "integer"
870+
},
871+
"sendBatchMaxSize": {
872+
"description": "Specifies the send_batch_max_size for the batch processor.",
873+
"type": "integer"
874+
},
875+
"timeout": {
876+
"description": "Specifies the timeout for the batch processor.",
877+
"type": "string"
878+
}
879+
}
858880
}
859881
}
860882
},

charts/opentelemetry-collector/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,13 @@ presets:
393393
zipkinReceiver:
394394
enabled: false
395395

396+
# Configuration for the batch processor.
397+
batch:
398+
enabled: false
399+
sendBatchSize: 1024
400+
sendBatchMaxSize: 2048
401+
timeout: "1s"
402+
396403
configMap:
397404
# Specifies whether a configMap should be created (true by default)
398405
create: true

0 commit comments

Comments
 (0)