Skip to content
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

Use max_log_size when recombining log entries #713

Merged
merged 1 commit into from
Mar 30, 2023
Merged
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 @@ -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
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