From 3bd7d357d5e27095c45d7dd18711d6a168477675 Mon Sep 17 00:00:00 2001 From: Benedikt Bongartz Date: Mon, 22 Apr 2024 15:31:07 +0200 Subject: [PATCH] OBSDOCS-1020: Add k8s object receiver to otel components - add filestorage ext to otel components Signed-off-by: Benedikt Bongartz --- modules/otel-collector-components.adoc | 92 ++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/modules/otel-collector-components.adoc b/modules/otel-collector-components.adoc index 5824b191df39..662d1ad983fa 100644 --- a/modules/otel-collector-components.adoc +++ b/modules/otel-collector-components.adoc @@ -82,6 +82,98 @@ The Jaeger receiver ingests traces in the Jaeger formats. <4> The Jaeger Thrift Binary endpoint. If omitted, the default `+0.0.0.0:6832+` is used. <5> The server-side TLS configuration. See the OTLP receiver configuration section for more details. +[id="k8sobjectsreceiver-receiver_{context}"] +=== Kubernetes Objects Receiver + +:FeatureName: The Kubernetes Objects Receiver +include::snippets/technology-preview.adoc[] + +The Kubernetes Objects Receiver pulls or watches objects to be collected from the Kubernetes API server. +This receiver watches primarily Kubernetes events, but it can collect any type of Kubernetes objects. +This receiver gathers telemetry for the cluster as a whole, so only one instance of this receiver suffices for collecting all the data. + +.OpenTelemetry Collector custom resource with an enabled Kubernetes Objects Receiver +[source,yaml] +---- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: otel-k8sobj + namespace: +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: otel-k8sobj + namespace: +rules: +- apiGroups: + - "" + resources: + - events + - pods + verbs: + - get + - list + - watch +- apiGroups: + - "events.k8s.io" + resources: + - events + verbs: + - watch + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: otel-k8sobj +subjects: + - kind: ServiceAccount + name: otel-k8sobj + namespace: +roleRef: + kind: ClusterRole + name: otel-k8sobj + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: opentelemetry.io/v1alpha1 +kind: OpenTelemetryCollector +metadata: + name: otel-k8s-obj + namespace: +spec: + serviceAccount: otel-k8sobj + image: ghcr.io/os-observability/redhat-opentelemetry-collector/redhat-opentelemetry-collector:main + mode: deployment + config: | + receivers: + k8sobjects: + auth_type: serviceAccount + objects: + - name: pods # <1> + mode: pull # <2> + interval: 30s # <3> + label_selector: # <4> + field_selector: # <5> + namespaces: [,...] # <6> + - name: events + mode: watch + exporters: + debug: + service: + pipelines: + logs: + receivers: [k8sobjects] + exporters: [debug] +---- +<1> The Resource name that this receiver observes: for example, `pods`, `deployments`, or `events`. +<2> The observation mode that this receiver uses: `pull` or `watch`. +<3> Only applicable to the pull mode. The request interval for pulling an object. If omitted, the default value is `+1h+`. +<4> The label selector to define targets. +<5> The field selector to filter targets. +<6> The list of namespaces to collect events from. If omitted, the default value is `+all+`. + [id="prometheus-receiver_{context}"] === Prometheus Receiver