Skip to content

Commit 69f493c

Browse files
authored
Merge pull request #75335 from max-cx/OBSDOCS-1020
OBSDOCS-1020/TRACING-4075: Write documentation for the k8sobjectsreceiver component
2 parents a9e992b + b948257 commit 69f493c

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

modules/otel-collector-components.adoc

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,98 @@ The Jaeger receiver ingests traces in the Jaeger formats.
8282
<4> The Jaeger Thrift Binary endpoint. If omitted, the default `+0.0.0.0:6832+` is used.
8383
<5> The server-side TLS configuration. See the OTLP receiver configuration section for more details.
8484

85+
[id="k8sobjectsreceiver-receiver_{context}"]
86+
=== Kubernetes Objects Receiver
87+
88+
:FeatureName: The Kubernetes Objects Receiver
89+
include::snippets/technology-preview.adoc[]
90+
91+
The Kubernetes Objects Receiver pulls or watches objects to be collected from the Kubernetes API server.
92+
This receiver watches primarily Kubernetes events, but it can collect any type of Kubernetes objects.
93+
This receiver gathers telemetry for the cluster as a whole, so only one instance of this receiver suffices for collecting all the data.
94+
95+
.OpenTelemetry Collector custom resource with an enabled Kubernetes Objects Receiver
96+
[source,yaml]
97+
----
98+
apiVersion: v1
99+
kind: ServiceAccount
100+
metadata:
101+
name: otel-k8sobj
102+
namespace: <namespace>
103+
---
104+
apiVersion: rbac.authorization.k8s.io/v1
105+
kind: ClusterRole
106+
metadata:
107+
name: otel-k8sobj
108+
namespace: <namespace>
109+
rules:
110+
- apiGroups:
111+
- ""
112+
resources:
113+
- events
114+
- pods
115+
verbs:
116+
- get
117+
- list
118+
- watch
119+
- apiGroups:
120+
- "events.k8s.io"
121+
resources:
122+
- events
123+
verbs:
124+
- watch
125+
- list
126+
---
127+
apiVersion: rbac.authorization.k8s.io/v1
128+
kind: ClusterRoleBinding
129+
metadata:
130+
name: otel-k8sobj
131+
subjects:
132+
- kind: ServiceAccount
133+
name: otel-k8sobj
134+
namespace: <namespace>
135+
roleRef:
136+
kind: ClusterRole
137+
name: otel-k8sobj
138+
apiGroup: rbac.authorization.k8s.io
139+
---
140+
apiVersion: opentelemetry.io/v1alpha1
141+
kind: OpenTelemetryCollector
142+
metadata:
143+
name: otel-k8s-obj
144+
namespace: <namespace>
145+
spec:
146+
serviceAccount: otel-k8sobj
147+
image: ghcr.io/os-observability/redhat-opentelemetry-collector/redhat-opentelemetry-collector:main
148+
mode: deployment
149+
config: |
150+
receivers:
151+
k8sobjects:
152+
auth_type: serviceAccount
153+
objects:
154+
- name: pods # <1>
155+
mode: pull # <2>
156+
interval: 30s # <3>
157+
label_selector: # <4>
158+
field_selector: # <5>
159+
namespaces: [<namespace>,...] # <6>
160+
- name: events
161+
mode: watch
162+
exporters:
163+
debug:
164+
service:
165+
pipelines:
166+
logs:
167+
receivers: [k8sobjects]
168+
exporters: [debug]
169+
----
170+
<1> The Resource name that this receiver observes: for example, `pods`, `deployments`, or `events`.
171+
<2> The observation mode that this receiver uses: `pull` or `watch`.
172+
<3> Only applicable to the pull mode. The request interval for pulling an object. If omitted, the default value is `+1h+`.
173+
<4> The label selector to define targets.
174+
<5> The field selector to filter targets.
175+
<6> The list of namespaces to collect events from. If omitted, the default value is `+all+`.
176+
85177
[id="prometheus-receiver_{context}"]
86178
=== Prometheus Receiver
87179

0 commit comments

Comments
 (0)