From ad65c24ea573a96351524d6a3529b596d3f3e13a Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Fri, 22 Mar 2024 16:37:35 +0100 Subject: [PATCH] TRACING-4067: add documentation for kubelet stats receiver Signed-off-by: Israel Blancas --- modules/otel-collector-components.adoc | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/modules/otel-collector-components.adoc b/modules/otel-collector-components.adoc index 9b0a27728c6f..5edf96ff6bea 100644 --- a/modules/otel-collector-components.adoc +++ b/modules/otel-collector-components.adoc @@ -259,6 +259,57 @@ spec: <5> The field selector to filter targets. <6> The list of namespaces to collect events from. If omitted, the default value is `+all+`. +[id="kubeletstats-receiver_{context}"] +=== Kubelet Stats Receiver + +:FeatureName: The Kubelet Stats Receiver +include::snippets/technology-preview.adoc[] + +The Kubelet Stats Receiver extracts metrics related to nodes, pods, containers, and volumes from the kubelet's API server. These metrics are then channeled through the metrics-processing pipeline for additional analysis. + +.OpenTelemetry Collector custom resource with an enabled Kubelet Stats Receiver +[source,yaml] +---- +# ... +config: | + receivers: + kubeletstats: + collection_interval: 20s + auth_type: "serviceAccount" + endpoint: "https://${env:K8S_NODE_NAME}:10250" + insecure_skip_verify: true + service: + pipelines: + metrics: + receivers: [kubeletstats] +env: + - name: K8S_NODE_NAME # <1> + valueFrom: + fieldRef: + fieldPath: spec.nodeName +# ... +---- +<1> Sets the `K8S_NODE_NAME` to authenticate to the API. + +The Kubelet Stats Receiver requires additional permissions for the service account used for running the OpenTelemetry Collector. + +.Permissions required by the service account +[source,yaml] +---- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: otel-collector +rules: + - apiGroups: [''] + resources: ['nodes/stats'] + verbs: ['get', 'watch', 'list'] + - apiGroups: [""] + resources: ["nodes/proxy"] # <1> + verbs: ["get"] +---- +<1> The permissions required when using the `extra_metadata_labels` or `request_utilization` or `limit_utilization` metrics. + [id="prometheus-receiver_{context}"] === Prometheus Receiver