Skip to content

kubelet-to-gcm: export RSS and pod memory metrics - #1293

Open
csbell wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
csbell:export-rss-pod-memory-upstream
Open

csbell wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
csbell:export-rss-pod-memory-upstream

Conversation

@csbell

@csbell csbell commented Oct 11, 2026

Copy link
Copy Markdown

Export three new GAUGE INT64 memory metrics from kubelet summary stats when using the new resource model (!useOldResourceModel):

  • kubernetes.io/master/kubelet/container_memory_rss on the container resource (e.g., internal_gke_master_container) from ContainerStats.Memory.RSSBytes.
  • kubernetes.io/master/kubelet/pod_memory_rss on the pod resource (e.g., internal_gke_master_pod) from PodStats.Memory.RSSBytes.
  • kubernetes.io/master/kubelet/pod_memory_working_set on the pod resource (e.g., internal_gke_master_pod) from PodStats.Memory.WorkingSetBytes.

Extend getMonitoredResource to construct the pod monitored resource (schemaPrefix + "pod") with pod_name and namespace_name when no container label is present and a namespace label is provided.

cc @courageJ

Export three new GAUGE INT64 memory metrics from kubelet summary stats
when using the new resource model (!useOldResourceModel):
- kubernetes.io/master/kubelet/container_memory_rss on the container
  resource (e.g., internal_gke_master_container) from
  ContainerStats.Memory.RSSBytes.
- kubernetes.io/master/kubelet/pod_memory_rss on the pod resource
  (e.g., internal_gke_master_pod) from PodStats.Memory.RSSBytes.
- kubernetes.io/master/kubelet/pod_memory_working_set on the pod
  resource (e.g., internal_gke_master_pod) from
  PodStats.Memory.WorkingSetBytes.

Extend getMonitoredResource to construct the pod monitored resource
(schemaPrefix + "pod") with pod_name and namespace_name when no
container label is present and a namespace label is provided.
@courageJ
courageJ self-requested a review October 11, 2026 17:42
value: 65432100,
metricKind: "GAUGE",
valueType: "INT64",
startTime: "2025-04-29T15:24:11Z",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is timezone dependent (fails locally outside UTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants