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

Add journald config #290

Merged
merged 62 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
b2efe02
added journald config to olly chart
luckyj5 Nov 16, 2021
e00da4e
update values.yaml
luckyj5 Nov 16, 2021
b06d27b
render update
luckyj5 Nov 16, 2021
4f4ebf6
Merge branch 'main' into add-journald-config
luckyj5 Nov 16, 2021
4a6e6f1
render update2
luckyj5 Nov 16, 2021
18e1da9
updated conditional logic in the chart for journald receiver
luckyj5 Nov 16, 2021
1e0fda4
updated if/else condition for journald config
luckyj5 Nov 17, 2021
c5fd2e7
Merge branch 'main' into add-journald-config
luckyj5 Nov 17, 2021
5eb3aec
update render
luckyj5 Nov 17, 2021
36d15ac
added journald config to olly chart
luckyj5 Nov 16, 2021
300e409
render update
luckyj5 Nov 16, 2021
29db45e
merge
luckyj5 Nov 25, 2021
10d6db4
render update
luckyj5 Nov 25, 2021
0d6f56d
update values
luckyj5 Nov 25, 2021
c4f49fd
update based on PR review
luckyj5 Dec 7, 2021
e87e54e
render update
luckyj5 Dec 7, 2021
95d94ab
update based on PR review
luckyj5 Nov 25, 2021
257801f
merge latest changes
luckyj5 Dec 7, 2021
0457640
fix linting errors
luckyj5 Dec 7, 2021
af8630e
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Dec 7, 2021
d69fccf
Update values.yaml
luckyj5 Dec 7, 2021
a40a460
Merge remote-tracking branch 'upstream/main' into add-journald-config
luckyj5 Dec 9, 2021
6ecc917
update render
luckyj5 Dec 9, 2021
5d52dcb
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Dec 13, 2021
3651170
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Dec 13, 2021
bd8bcd8
Merge remote-tracking branch 'upstream/main' into add-journald-config
luckyj5 Dec 13, 2021
52d9a82
update render
luckyj5 Dec 13, 2021
2b7ad93
Squashed commit of the following:
luckyj5 Dec 13, 2021
17c6961
update render
luckyj5 Dec 13, 2021
7b766d0
Merge remote-tracking branch 'upstream/main' into add-journald-config
luckyj5 Dec 13, 2021
750dc2b
update render
luckyj5 Dec 13, 2021
285fd78
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Dec 13, 2021
2506114
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Dec 14, 2021
adc8900
update agent template
luckyj5 Dec 15, 2021
c9cf143
added journald advance config section and changelog
luckyj5 Dec 15, 2021
cd58035
fix typo
luckyj5 Dec 15, 2021
d7e380a
Update helm-charts/splunk-otel-collector/templates/config/_otel-agent…
luckyj5 Dec 16, 2021
bc610c1
Update helm-charts/splunk-otel-collector/values.yaml
luckyj5 Dec 16, 2021
1ffdb1e
update per pr review
luckyj5 Dec 17, 2021
b031204
fix whitespace
luckyj5 Dec 17, 2021
6d09c72
update per review comments
luckyj5 Dec 21, 2021
e1bf0fc
update journal path directory default value
luckyj5 Dec 21, 2021
cbc6e1d
update render
luckyj5 Dec 21, 2021
8fa229a
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Dec 21, 2021
ec70eb6
update closing tags
luckyj5 Dec 23, 2021
f3bf62f
update template
luckyj5 Dec 23, 2021
fe2743a
update render
luckyj5 Dec 23, 2021
a91a15e
added filter to discard not useful fields
luckyj5 Jan 5, 2022
d6f660b
move MESSAGE to log body and priority & unit to attributes
luckyj5 Jan 19, 2022
fb435da
update render
luckyj5 Jan 19, 2022
e17098f
Merge branch 'main' into add-journald-config
luckyj5 Jan 19, 2022
721fe21
update render
luckyj5 Jan 19, 2022
3b7e3c8
update Changelog
luckyj5 Jan 19, 2022
69b2175
update comments
luckyj5 Jan 19, 2022
44cd758
udpate to remove unit-name when its not present
luckyj5 Jan 19, 2022
6fc8e8b
udpate default units value and disable journald by default
luckyj5 Jan 20, 2022
5482e07
Merge branch 'signalfx:main' into add-journald-config
luckyj5 Jan 20, 2022
eeceaf1
Update CHANGELOG.md
luckyj5 Jan 20, 2022
5641b2f
update docs and clean up
luckyj5 Jan 20, 2022
88547b3
update render
luckyj5 Jan 20, 2022
5996f07
update journald sourcetype format to be consistent with other sourcet…
luckyj5 Jan 20, 2022
6026b7b
update schema for units object
luckyj5 Jan 20, 2022
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 @@ -235,7 +235,37 @@ receivers:
from: log
to: $$
{{- end }}

dmitryax marked this conversation as resolved.
Show resolved Hide resolved
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/journaldreceiver
{{- if (eq (include "splunk-otel-collector.logsEnabled" .) "true") }}
{{- if and (eq .Values.logsEngine "otel") .Values.logsCollection.journaldLogs.enabled }}
{{- if .Values.logsCollection.journaldLogs.units }}
{{- range $_, $unit := .Values.logsCollection.journaldLogs.units }}
{{- printf "journald/%s:" $unit.name | nindent 2 }}
directory: {{ $.Values.logsCollection.journaldLogs.directory }}
units: [{{ $unit.name }}]
priority: {{ $unit.priority | default $.Values.logsCollection.journaldLogs.defaultPriority }}
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
resource:
com.splunk.source: {{ $.Values.logsCollection.journaldLogs.directory }}
com.splunk.sourcetype: 'EXPR("kube:"+$$._SYSTEMD_UNIT)'
com.splunk.index: {{ $.Values.logsCollection.journaldLogs.index | default $.Values.splunkPlatform.index}}
host.name: 'EXPR(env("K8S_NODE_NAME"))'
{{- if $.Values.clusterName }}
k8s.cluster.name: {{ $.Values.clusterName }}
{{- end }}
{{- if $.Values.environment }}
deployment.environment: {{ $.Values.environment }}
{{- end }}
{{- if $.Values.extraAttributes.custom }}
{{- toYaml $.Values.extraAttributes.custom | nindent 6 }}
{{- end }}
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
{{- end }}
{{- end }}
{{- else }}
journald:
directory: {{- toYaml .Values.logsCollection.journaldLogs.directory | nindent 6 }}
priority: {{ .Values.logsCollection.journaldLogs.defaultPriority }}
{{- end }}
{{- end }}
# By default k8sattributes and batch processors enabled.
processors:
# k8sattributes enriches traces and metrics with k8s metadata
Expand Down Expand Up @@ -532,4 +562,31 @@ service:
{{- end }}
{{- end }}
{{- end }}

{{- if (eq (include "splunk-otel-collector.logsEnabled" .) "true") }}
{{- if and (eq .Values.logsEngine "otel") .Values.logsCollection.journaldLogs.enabled }}
logs/journald:
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
receivers:
{{- if .Values.logsCollection.journaldLogs.units }}
{{- range $_, $unit := .Values.logsCollection.journaldLogs.units }}
{{- printf "- journald/%s" $unit.name | nindent 8 }}
{{- end }}
{{- else }}
- journald
{{- end }}
processors:
- batch
exporters:
{{- if .Values.otelCollector.enabled }}
- otlp
{{- else }}
{{- if (eq (include "splunk-otel-collector.o11yLogsEnabled" .) "true") }}
- splunk_hec/o11y
{{- end }}
{{- if (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") }}
- splunk_hec/platform_logs
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ spec:
readOnly: true
- name: checkpoint
mountPath: {{ .Values.logsCollection.checkpointPath }}
{{- if .Values.logsCollection.journaldLogs.enabled}}
- mountPath: {{.Values.logsCollection.journaldLogs.directory}}
name: journaldlogs-otel
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.otelAgent.extraVolumeMounts }}
{{- toYaml .Values.otelAgent.extraVolumeMounts | nindent 8 }}
Expand Down Expand Up @@ -365,6 +370,11 @@ spec:
hostPath:
path: {{ .Values.logsCollection.checkpointPath }}
type: DirectoryOrCreate
{{- if .Values.logsCollection.journaldLogs.enabled}}
- name: journaldlogs-otel
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
hostPath:
path: {{.Values.logsCollection.journaldLogs.directory}}
{{- end}}
{{- end}}
{{- end}}
{{- if eq (include "splunk-otel-collector.metricsEnabled" $) "true" }}
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/splunk-otel-collector/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,12 @@
}
}
},
"journaldLogs": {
"type": "object",
"items": {
"type": "object"
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
}
},
"checkpointPath": {
"type": "string"
}
Expand Down
15 changes: 15 additions & 0 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,21 @@ logsCollection:
# value: server
# firstEntryRegex: ^[^\s].*

# Configuration for collecting journald logs using otel collector
journaldLogs:
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
enabled: true
directory: /run/log/journal
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
defaultPriority: info
# List of service units to collect and configuration for each. To collect all journald services logs, leave units blank.
units:
- name: kubelet
priority: info
- name: docker
priority: info
- name: containerd
priority: info
# Route journald logs to its own Splunk Index by specifying the index value below, else leave it blank. Please make sure the index exist in Splunk and is configured to receive HEC traffic.
luckyj5 marked this conversation as resolved.
Show resolved Hide resolved
index:
checkpointPath: "/var/lib/otel_pos"

################################################################################
Expand Down
3 changes: 3 additions & 0 deletions rendered/manifests/agent-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ data:
endpoint: 0.0.0.0:14250
thrift_http:
endpoint: 0.0.0.0:14268
journald:
luckyj5 marked this conversation as resolved.
Show resolved Hide resolved
directory: /run/log/journal
priority: info
kubeletstats:
auth_type: serviceAccount
collection_interval: 10s
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: 4eeca5afdb8456588b3f21440b9833d2f723f657ae167126f7f5182eea44bf30
checksum/config: 30edcde59e9ca392a04630e41bc491ed9317e597cf8b1c3aa36ea98b92f09cd9
kubectl.kubernetes.io/default-container: otel-collector
spec:
hostNetwork: true
Expand Down
3 changes: 3 additions & 0 deletions rendered/manifests/logs-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ data:
receivers:
fluentforward:
endpoint: 0.0.0.0:8006
journald:
luckyj5 marked this conversation as resolved.
Show resolved Hide resolved
directory: /run/log/journal
priority: info
otlp:
protocols:
grpc:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: a31970065aabdf55dec4f5397d2d338f6b988f1599e0dca4ecf168fd294eb945
checksum/config: 69cb918c344b7fd787c77333133cc73371243be9050cd4691ea788298685ca11
kubectl.kubernetes.io/default-container: otel-collector
spec:
hostNetwork: true
Expand Down
42 changes: 42 additions & 0 deletions rendered/manifests/otel-logs/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,39 @@ data:
endpoint: 0.0.0.0:14250
thrift_http:
endpoint: 0.0.0.0:14268
journald/containerd:
directory: /run/log/journal
priority: info
resource:
com.splunk.index: null
com.splunk.source: /run/log/journal
com.splunk.sourcetype: EXPR("kube:"+$$._SYSTEMD_UNIT)
host.name: EXPR(env("K8S_NODE_NAME"))
k8s.cluster.name: CHANGEME
units:
- containerd
journald/docker:
directory: /run/log/journal
priority: info
resource:
com.splunk.index: null
com.splunk.source: /run/log/journal
com.splunk.sourcetype: EXPR("kube:"+$$._SYSTEMD_UNIT)
host.name: EXPR(env("K8S_NODE_NAME"))
k8s.cluster.name: CHANGEME
units:
- docker
journald/kubelet:
directory: /run/log/journal
priority: info
resource:
com.splunk.index: null
com.splunk.source: /run/log/journal
com.splunk.sourcetype: EXPR("kube:"+$$._SYSTEMD_UNIT)
host.name: EXPR(env("K8S_NODE_NAME"))
k8s.cluster.name: CHANGEME
units:
- kubelet
kubeletstats:
auth_type: serviceAccount
collection_interval: 10s
Expand Down Expand Up @@ -291,6 +324,15 @@ data:
- filelog
- fluentforward
- otlp
logs/journald:
exporters:
- splunk_hec/o11y
processors:
- batch
receivers:
- journald/kubelet
- journald/docker
- journald/containerd
metrics:
exporters:
- signalfx
Expand Down
8 changes: 7 additions & 1 deletion rendered/manifests/otel-logs/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: 79fbef3ed17c5716a0d28f36d47d1f28fa123718a75dd9865dec2160707b0b47
checksum/config: d9a2677e16887f2d810df5c2dbac2fb3a0abf4ffa6d7b910dad19480f9c13dbf
kubectl.kubernetes.io/default-container: otel-collector
spec:
hostNetwork: true
Expand Down Expand Up @@ -204,6 +204,9 @@ spec:
readOnly: true
- name: checkpoint
mountPath: /var/lib/otel_pos
- mountPath: /run/log/journal
name: journaldlogs-otel
readOnly: true
terminationGracePeriodSeconds: 600
volumes:
- name: varlog
Expand All @@ -216,6 +219,9 @@ spec:
hostPath:
path: /var/lib/otel_pos
type: DirectoryOrCreate
- name: journaldlogs-otel
hostPath:
path: /run/log/journal
- name: host-dev
hostPath:
path: /dev
Expand Down