EAI-5958: Stamp workload_id on per-pod CPU/memory metrics - #806
Closed
johnl-amd wants to merge 1 commit into
Closed
Conversation
…mem metrics Per-pod CPU and memory time-series are needed for EPYC (CPU-only) AIM observability in the AIWB dashboard, scoped the same way GPU/VRAM metrics already are: by a stable workload_id label. cAdvisor metrics (scraped by otel-collector-metrics-k8s via a node-role scrape) are node-scoped, so pod/namespace arrive as datapoint labels and cannot be associated to a pod by the k8sattributes processor, which works at the resource level. As a result container_cpu_usage_seconds_total / container_memory_working_set_bytes carry no workload_id. Add a dedicated daemonset collector using the kubeletstats receiver, which emits pod/container-scoped metrics with k8s.pod.* as resource attributes. k8sattributes then looks up the pod and stamps its airm.silogen.ai/workload-id (and project-id) label; a transform copies the identity resource attributes down to datapoint attributes so they survive OTLP ingestion as series labels (workload_id, project_id, pod, namespace, container). Reuses the existing otel-collector ServiceAccount (RBAC already grants nodes/stats). Runtime validation deferred: app-dev is unreachable and the local kind cluster is degraded (host inotify limit exhausted).
Contributor
Author
|
Superseded by #807, which is the same kubeletstats collector change based on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kubeletstatsdaemonset collector (otel-collector-metrics-kubelet) to theotel-lgtm-stackchart that emits per-pod CPU and memory metrics labeled withworkload_id(plusproject_id,pod,namespace,container).Why
EPYC-based AIMs (parent initiative EAI-2244) hold model weights in RAM, so the AIWB dashboard needs CPU + system-memory panels alongside the existing GPU/VRAM panels. The AIWB metrics backend scopes every panel by a
workload_id="<AIM-uuid>"label. GPU metrics carry that label (stamped by the device-metrics-exporter); vLLM metrics carry it (vLLM collector relabel). Container CPU/memory metrics do not.Root cause of the gap
otel-collector-metrics-k8sscrapes cAdvisor via arole: nodescrape (/metrics/cadvisor). Those metrics are node-scoped, sopod/namespacearrive as datapoint labels. Thek8sattributesprocessor associates pods at the resource level, so it cannot enrich node-scoped cAdvisor series — leavingcontainer_cpu_usage_seconds_total/container_memory_working_set_byteswithoutworkload_id.Approach
Use the
kubeletstatsreceiver instead, which emits pod/container-scoped metrics withk8s.pod.*as resource attributes:kubeletstats(daemonset, per-node kubelet at:10250) → pod + container metric groups.k8sattributeslooks up the pod and extractsairm.silogen.ai/workload-id→workload.id(andproject-id).transform/workload-id-labelscopies the identity resource attributes down to datapoint attributes, so they survive OTLP→Mimir ingestion as series labels (resource attributes otherwise land intarget_info, not on the series).Reuses the existing
otel-collectorServiceAccount — RBAC already grantsnodes/stats,nodes/proxy,pods,namespaces, so no RBAC change is needed.Risk
Low–medium. Additive: a new collector; existing pipelines are untouched. New series (
k8s_pod_cpu_*,k8s_pod_memory_*,k8s_container_*) with per-pod cardinality (comparable to existing cAdvisor series). Uses the same collector image and OTLP endpoint as the other collectors.Test plan / validation status
k8sattributes/workload-idpattern already used by the logs collector and the vLLM collector.k8s_pod_cpu_usage{workload_id="<aim-uuid>"}andk8s_pod_memory_working_set_bytes{workload_id="<aim-uuid>"}return series for a labeled workload pod, and thatworkload_id/namespace/podappear as labels.Follow-ups (separate work, not in this PR)
MetricNameentries + PromQL builders for CPU usage / CPU availability / system memory.