Skip to content

Commit 16743d5

Browse files
authored
Merge pull request #101672 from max-cx/OBSDOCS-2520
OBSDOCS-2520: Modularize otel-collector-receivers.adoc
2 parents 9f3b01e + cbc825b commit 16743d5

15 files changed

+923
-840
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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-filelog-receiver_{context}"]
7+
= Filelog Receiver
8+
9+
[role="_abstract"]
10+
The Filelog Receiver tails and parses logs from files.
11+
12+
:FeatureName: The Filelog Receiver
13+
include::snippets/technology-preview.adoc[]
14+
15+
.OpenTelemetry Collector custom resource with the enabled Filelog Receiver that tails a text file
16+
[source,yaml]
17+
----
18+
# ...
19+
config:
20+
receivers:
21+
filelog:
22+
include: [ /simple.log ] # <1>
23+
operators: # <2>
24+
- type: regex_parser
25+
regex: '^(?P<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (?P<sev>[A-Z]*) (?P<msg>.*)$'
26+
timestamp:
27+
parse_from: attributes.time
28+
layout: '%Y-%m-%d %H:%M:%S'
29+
severity:
30+
parse_from: attributes.sev
31+
# ...
32+
----
33+
<1> A list of file glob patterns that match the file paths to be read.
34+
<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.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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-hostmetrics-receiver_{context}"]
7+
= Host Metrics Receiver
8+
9+
[role="_abstract"]
10+
The Host Metrics Receiver ingests metrics in the OTLP format.
11+
12+
.OpenTelemetry Collector custom resource with an enabled Host Metrics Receiver
13+
[source,yaml]
14+
----
15+
apiVersion: v1
16+
kind: ServiceAccount
17+
metadata:
18+
name: otel-hostfs-daemonset
19+
namespace: <namespace>
20+
# ...
21+
---
22+
apiVersion: security.openshift.io/v1
23+
kind: SecurityContextConstraints
24+
allowHostDirVolumePlugin: true
25+
allowHostIPC: false
26+
allowHostNetwork: false
27+
allowHostPID: true
28+
allowHostPorts: false
29+
allowPrivilegeEscalation: true
30+
allowPrivilegedContainer: true
31+
allowedCapabilities: null
32+
defaultAddCapabilities:
33+
- SYS_ADMIN
34+
fsGroup:
35+
type: RunAsAny
36+
groups: []
37+
metadata:
38+
name: otel-hostmetrics
39+
readOnlyRootFilesystem: true
40+
runAsUser:
41+
type: RunAsAny
42+
seLinuxContext:
43+
type: RunAsAny
44+
supplementalGroups:
45+
type: RunAsAny
46+
users:
47+
- system:serviceaccount:<namespace>:otel-hostfs-daemonset
48+
volumes:
49+
- configMap
50+
- emptyDir
51+
- hostPath
52+
- projected
53+
# ...
54+
---
55+
apiVersion: opentelemetry.io/v1beta1
56+
kind: OpenTelemetryCollector
57+
metadata:
58+
name: otel
59+
namespace: <namespace>
60+
spec:
61+
serviceAccount: otel-hostfs-daemonset
62+
mode: daemonset
63+
volumeMounts:
64+
- mountPath: /hostfs
65+
name: host
66+
readOnly: true
67+
volumes:
68+
- hostPath:
69+
path: /
70+
name: host
71+
config:
72+
receivers:
73+
hostmetrics:
74+
collection_interval: 10s # <1>
75+
initial_delay: 1s # <2>
76+
root_path: / # <3>
77+
scrapers: # <4>
78+
cpu: {}
79+
memory: {}
80+
disk: {}
81+
service:
82+
pipelines:
83+
metrics:
84+
receivers: [hostmetrics]
85+
# ...
86+
----
87+
<1> Sets the time interval for host metrics collection. If omitted, the default value is `+1m+`.
88+
<2> Sets the initial time delay for host metrics collection. If omitted, the default value is `+1s+`.
89+
<3> Configures the `root_path` so that the Host Metrics Receiver knows where the root filesystem is. If running multiple instances of the Host Metrics Receiver, set the same `root_path` value for each instance.
90+
<4> Lists the enabled host metrics scrapers. Available scrapers are `cpu`, `disk`, `load`, `filesystem`, `memory`, `network`, `paging`, `processes`, and `process`.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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-jaeger-receiver_{context}"]
7+
= Jaeger Receiver
8+
9+
[role="_abstract"]
10+
The Jaeger Receiver ingests traces in the Jaeger formats.
11+
12+
.OpenTelemetry Collector custom resource with an enabled Jaeger Receiver
13+
[source,yaml]
14+
----
15+
# ...
16+
config:
17+
receivers:
18+
jaeger:
19+
protocols:
20+
grpc:
21+
endpoint: 0.0.0.0:14250 # <1>
22+
thrift_http:
23+
endpoint: 0.0.0.0:14268 # <2>
24+
thrift_compact:
25+
endpoint: 0.0.0.0:6831 # <3>
26+
thrift_binary:
27+
endpoint: 0.0.0.0:6832 # <4>
28+
tls: {} # <5>
29+
30+
service:
31+
pipelines:
32+
traces:
33+
receivers: [jaeger]
34+
# ...
35+
----
36+
<1> The Jaeger gRPC endpoint. If omitted, the default `+0.0.0.0:14250+` is used.
37+
<2> The Jaeger Thrift HTTP endpoint. If omitted, the default `+0.0.0.0:14268+` is used.
38+
<3> The Jaeger Thrift Compact endpoint. If omitted, the default `+0.0.0.0:6831+` is used.
39+
<4> The Jaeger Thrift Binary endpoint. If omitted, the default `+0.0.0.0:6832+` is used.
40+
<5> The server-side TLS configuration. See the OTLP Receiver configuration section for more details.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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

Comments
 (0)