|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * observability/otel/otel-collector/otel-collector-receivers.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: REFERENCE |
| 6 | +[id="otel-receivers-journald-receiver_{context}"] |
| 7 | += Journald Receiver |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +The Journald Receiver parses *journald* events from the *systemd* journal and sends them as logs. |
| 11 | + |
| 12 | +:FeatureName: The Journald Receiver |
| 13 | +include::snippets/technology-preview.adoc[] |
| 14 | + |
| 15 | +.OpenTelemetry Collector custom resource with the enabled Journald Receiver |
| 16 | +[source,yaml] |
| 17 | +---- |
| 18 | +apiVersion: v1 |
| 19 | +kind: Namespace |
| 20 | +metadata: |
| 21 | + name: otel-journald |
| 22 | + labels: |
| 23 | + security.openshift.io/scc.podSecurityLabelSync: "false" |
| 24 | + pod-security.kubernetes.io/enforce: "privileged" |
| 25 | + pod-security.kubernetes.io/audit: "privileged" |
| 26 | + pod-security.kubernetes.io/warn: "privileged" |
| 27 | +# ... |
| 28 | +--- |
| 29 | +apiVersion: v1 |
| 30 | +kind: ServiceAccount |
| 31 | +metadata: |
| 32 | + name: privileged-sa |
| 33 | + namespace: otel-journald |
| 34 | +# ... |
| 35 | +--- |
| 36 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 37 | +kind: ClusterRoleBinding |
| 38 | +metadata: |
| 39 | + name: otel-journald-binding |
| 40 | +roleRef: |
| 41 | + apiGroup: rbac.authorization.k8s.io |
| 42 | + kind: ClusterRole |
| 43 | + name: system:openshift:scc:privileged |
| 44 | +subjects: |
| 45 | +- kind: ServiceAccount |
| 46 | + name: privileged-sa |
| 47 | + namespace: otel-journald |
| 48 | +# ... |
| 49 | +--- |
| 50 | +apiVersion: opentelemetry.io/v1beta1 |
| 51 | +kind: OpenTelemetryCollector |
| 52 | +metadata: |
| 53 | + name: otel-journald-logs |
| 54 | + namespace: otel-journald |
| 55 | +spec: |
| 56 | + mode: daemonset |
| 57 | + serviceAccount: privileged-sa |
| 58 | + securityContext: |
| 59 | + allowPrivilegeEscalation: false |
| 60 | + capabilities: |
| 61 | + drop: |
| 62 | + - CHOWN |
| 63 | + - DAC_OVERRIDE |
| 64 | + - FOWNER |
| 65 | + - FSETID |
| 66 | + - KILL |
| 67 | + - NET_BIND_SERVICE |
| 68 | + - SETGID |
| 69 | + - SETPCAP |
| 70 | + - SETUID |
| 71 | + readOnlyRootFilesystem: true |
| 72 | + seLinuxOptions: |
| 73 | + type: spc_t |
| 74 | + seccompProfile: |
| 75 | + type: RuntimeDefault |
| 76 | + config: |
| 77 | + receivers: |
| 78 | + journald: |
| 79 | + files: /var/log/journal/*/* |
| 80 | + priority: info # <1> |
| 81 | + units: # <2> |
| 82 | + - kubelet |
| 83 | + - crio |
| 84 | + - init.scope |
| 85 | + - dnsmasq |
| 86 | + all: true # <3> |
| 87 | + retry_on_failure: |
| 88 | + enabled: true # <4> |
| 89 | + initial_interval: 1s # <5> |
| 90 | + max_interval: 30s # <6> |
| 91 | + max_elapsed_time: 5m # <7> |
| 92 | + processors: |
| 93 | + exporters: |
| 94 | + debug: {} |
| 95 | + service: |
| 96 | + pipelines: |
| 97 | + logs: |
| 98 | + receivers: [journald] |
| 99 | + exporters: [debug] |
| 100 | + volumeMounts: |
| 101 | + - name: journal-logs |
| 102 | + mountPath: /var/log/journal/ |
| 103 | + readOnly: true |
| 104 | + volumes: |
| 105 | + - name: journal-logs |
| 106 | + hostPath: |
| 107 | + path: /var/log/journal |
| 108 | + tolerations: |
| 109 | + - key: node-role.kubernetes.io/master |
| 110 | + operator: Exists |
| 111 | + effect: NoSchedule |
| 112 | +# ... |
| 113 | +---- |
| 114 | +<1> Filters output by message priorities or priority ranges. The default value is `info`. |
| 115 | +<2> Lists the units to read entries from. If empty, entries are read from all units. |
| 116 | +<3> Includes very long logs and logs with unprintable characters. The default value is `false`. |
| 117 | +<4> If set to `true`, the receiver pauses reading a file and attempts to resend the current batch of logs when encountering an error from downstream components. The default value is `false`. |
| 118 | +<5> The time interval to wait after the first failure before retrying. The default value is `1s`. The units are `ms`, `s`, `m`, `h`. |
| 119 | +<6> The upper bound for the retry backoff interval. When this value is reached, the time interval between consecutive retry attempts remains constant at this value. The default value is `30s`. The supported units are `ms`, `s`, `m`, `h`. |
| 120 | +<7> The maximum time interval, including retry attempts, for attempting to send a logs batch to a downstream consumer. When this value is reached, the data are discarded. If the set value is `0`, retrying never stops. The default value is `5m`. The supported units are `ms`, `s`, `m`, `h`. |
0 commit comments