Skip to content

Commit

Permalink
Use max_log_size when recombining log entries (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Mar 30, 2023
1 parent cc8b2f9 commit d29b28e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ data:
combine_with: ""
id: crio-recombine
is_last_entry: attributes.logtag == 'F'
max_log_size: 1048576
output: handle_empty_log
source_identifier: attributes["log.file.path"]
type: recombine
Expand All @@ -176,6 +177,7 @@ data:
combine_with: ""
id: containerd-recombine
is_last_entry: attributes.logtag == 'F'
max_log_size: 1048576
output: handle_empty_log
source_identifier: attributes["log.file.path"]
type: recombine
Expand All @@ -188,6 +190,7 @@ data:
combine_with: ""
id: docker-recombine
is_last_entry: attributes.log endsWith "\n"
max_log_size: 1048576
output: handle_empty_log
source_identifier: attributes["log.file.path"]
type: recombine
Expand Down
2 changes: 1 addition & 1 deletion examples/only-logs-otel/rendered_manifests/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: 664949a4d833c1a4b2a30964878c4e57c7029b9af1375b61097ecea125658b19
checksum/config: 08d4c631b80ddfd23d85c6b7fbe51d23e7fa1b701107bb41fe8fb8da0b1caeb4
kubectl.kubernetes.io/default-container: otel-collector
spec:
hostNetwork: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ receivers:
source_identifier: attributes["log.file.path"]
is_last_entry: "attributes.logtag == 'F'"
combine_with: ""
max_log_size: {{ $.Values.logsCollection.containers.maxRecombineLogSize }}
{{- end }}
{{- if or (not .Values.logsCollection.containers.containerRuntime) (eq .Values.logsCollection.containers.containerRuntime "containerd") }}
# Parse CRI-Containerd format
Expand All @@ -304,6 +305,7 @@ receivers:
source_identifier: attributes["log.file.path"]
is_last_entry: "attributes.logtag == 'F'"
combine_with: ""
max_log_size: {{ $.Values.logsCollection.containers.maxRecombineLogSize }}
{{- end }}
{{- if or (not .Values.logsCollection.containers.containerRuntime) (eq .Values.logsCollection.containers.containerRuntime "docker") }}
# Parse Docker format
Expand All @@ -319,6 +321,7 @@ receivers:
source_identifier: attributes["log.file.path"]
is_last_entry: attributes.log endsWith "\n"
combine_with: ""
max_log_size: {{ $.Values.logsCollection.containers.maxRecombineLogSize }}
{{- end }}
- type: add
id: handle_empty_log
Expand Down
3 changes: 3 additions & 0 deletions helm-charts/splunk-otel-collector/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,9 @@
"items": {
"type": "object"
}
},
"maxRecombineLogSize": {
"type": "integer"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ logsCollection:
# Set useSplunkIncludeAnnotation flag to `true` to collect logs from pods with `splunk.com/include: true` annotation and ignore others.
# All other logs will be ignored.
useSplunkIncludeAnnotation: false
# maxRecombineLogsSize sets the maximum size in bytes of a message recombined from cri-o, containerd and docker log entries.
# Set to 0 to remove any size limit.
maxRecombineLogSize: 1048576

# Configuration for collecting journald logs using otel collector
journald:
Expand Down

0 comments on commit d29b28e

Please sign in to comment.