Skip to content

Commit 990a7ab

Browse files
authored
Merge pull request #75257 from max-cx/otel-journald
OBSDOCS-953/TRACING-4062 Write documentation and technical enablement for journald component
2 parents 880365d + 713e4c5 commit 990a7ab

File tree

1 file changed

+117
-3
lines changed

1 file changed

+117
-3
lines changed

modules/otel-collector-components.adoc

Lines changed: 117 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Receivers get data into the Collector.
1414
[id="otlp-receiver_{context}"]
1515
=== OTLP Receiver
1616

17-
The OTLP receiver ingests traces and metrics using the OpenTelemetry protocol (OTLP).
17+
The OTLP receiver ingests traces, metrics, and logs by using the OpenTelemetry Protocol (OTLP).
1818

1919
.OpenTelemetry Collector custom resource with an enabled OTLP receiver
2020
[source,yaml]
@@ -43,9 +43,9 @@ The OTLP receiver ingests traces and metrics using the OpenTelemetry protocol (O
4343
receivers: [otlp]
4444
----
4545
<1> The OTLP gRPC endpoint. If omitted, the default `+0.0.0.0:4317+` is used.
46-
<2> The server-side TLS configuration. Defines paths to TLS certificates. If omitted, TLS is disabled.
46+
<2> The server-side TLS configuration. Defines paths to TLS certificates. If omitted, the TLS is disabled.
4747
<3> The path to the TLS certificate at which the server verifies a client certificate. This sets the value of `ClientCAs` and `ClientAuth` to `RequireAndVerifyClientCert` in the `TLSConfig`. For more information, see the link:https://godoc.org/crypto/tls#Config[`Config` of the Golang TLS package].
48-
<4> Specifies the time interval at which the certificate is reloaded. If the value is not set, the certificate is never reloaded. The `reload_interval` accepts a string containing valid units of time such as `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
48+
<4> Specifies the time interval at which the certificate is reloaded. If the value is not set, the certificate is never reloaded. The `reload_interval` field accepts a string containing valid units of time such as `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
4949
<5> The OTLP HTTP endpoint. The default value is `+0.0.0.0:4318+`.
5050
<6> The server-side TLS configuration. For more information, see the `grpc` protocol configuration section.
5151

@@ -590,6 +590,120 @@ receivers:
590590
<1> A list of file glob patterns that match the file paths to be read.
591591
<2> An array of Operators. Each Operator performs a simple task such as parsing a timestamp or JSON. To process logs into a desired format, chain the Operators together.
592592

593+
[id="journald-receiver_{context}"]
594+
=== Journald Receiver
595+
596+
:FeatureName: The Journald Receiver
597+
include::snippets/technology-preview.adoc[]
598+
599+
The Journald Receiver parses *journald* events from the *systemd* journal and sends them as logs.
600+
601+
.OpenTelemetry Collector custom resource with the enabled Journald Receiver
602+
[source,yaml]
603+
----
604+
kubectl apply -f - <<EOF
605+
apiVersion: v1
606+
kind: Namespace
607+
metadata:
608+
name: otel-journald
609+
labels:
610+
security.openshift.io/scc.podSecurityLabelSync: "false"
611+
pod-security.kubernetes.io/enforce: "privileged"
612+
pod-security.kubernetes.io/audit: "privileged"
613+
pod-security.kubernetes.io/warn: "privileged"
614+
---
615+
apiVersion: v1
616+
kind: ServiceAccount
617+
metadata:
618+
name: privileged-sa
619+
namespace: otel-journald
620+
---
621+
apiVersion: rbac.authorization.k8s.io/v1
622+
kind: ClusterRoleBinding
623+
metadata:
624+
name: otel-journald-binding
625+
roleRef:
626+
apiGroup: rbac.authorization.k8s.io
627+
kind: ClusterRole
628+
name: system:openshift:scc:privileged
629+
subjects:
630+
- kind: ServiceAccount
631+
name: privileged-sa
632+
namespace: otel-journald
633+
---
634+
apiVersion: opentelemetry.io/v1alpha1
635+
kind: OpenTelemetryCollector
636+
metadata:
637+
name: otel-journald-logs
638+
namespace: otel-journald
639+
spec:
640+
mode: daemonset
641+
serviceAccount: privileged-sa
642+
securityContext:
643+
allowPrivilegeEscalation: false
644+
capabilities:
645+
drop:
646+
- CHOWN
647+
- DAC_OVERRIDE
648+
- FOWNER
649+
- FSETID
650+
- KILL
651+
- NET_BIND_SERVICE
652+
- SETGID
653+
- SETPCAP
654+
- SETUID
655+
readOnlyRootFilesystem: true
656+
seLinuxOptions:
657+
type: spc_t
658+
seccompProfile:
659+
type: RuntimeDefault
660+
config: |
661+
receivers:
662+
journald:
663+
files: /var/log/journal/*/*
664+
priority: info # <1>
665+
units: # <2>
666+
- kubelet
667+
- crio
668+
- init.scope
669+
- dnsmasq
670+
all: true # <3>
671+
retry_on_failure:
672+
enabled: true # <4>
673+
initial_interval: 1s # <5>
674+
max_interval: 30s # <6>
675+
max_elapsed_time: 5m # <7>
676+
processors:
677+
exporters:
678+
debug:
679+
verbosity: detailed
680+
service:
681+
pipelines:
682+
logs:
683+
receivers: [journald]
684+
exporters: [debug]
685+
volumeMounts:
686+
- name: journal-logs
687+
mountPath: /var/log/journal/
688+
readOnly: true
689+
volumes:
690+
- name: journal-logs
691+
hostPath:
692+
path: /var/log/journal
693+
tolerations:
694+
- key: node-role.kubernetes.io/master
695+
operator: Exists
696+
effect: NoSchedule
697+
EOF
698+
----
699+
<1> Filters output by message priorities or priority ranges. The default value is `info`.
700+
<2> Lists the units to read entries from. If empty, entries are read from all units.
701+
<3> Includes very long logs and logs with unprintable characters. The default value is `false`.
702+
<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`.
703+
<5> The time interval to wait after the first failure before retrying. The default value is `1s`. The units are `ms`, `s`, `m`, `h`.
704+
<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`.
705+
<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`.
706+
593707
[id="processors_{context}"]
594708
== Processors
595709

0 commit comments

Comments
 (0)