Skip to content

Collect Runtime Metrics ​

To monitor the health and resource usage of your Kubernetes cluster, enable the runtime input in your MetricPipeline. This uses an agent on each node to gather metrics for resources like Pods, Nodes, and Deployments. You can choose the specific resources to monitor and control from which namespaces metrics are collected.

Activate Runtime Metrics ​

By default, the runtime input is disabled. If you want to monitor your Kubernetes resources, enable the collection of runtime metrics:

yaml
...
  input:
    runtime:
      enabled: true

With this, the metric agent starts collecting all runtime metrics from all resources (Pod, container, Node, Volume, DaemonSet, Deployment, StatefulSet, and Job).

TIP

To select metrics from specific namespaces or to include system namespaces, see Filter Metrics.

Select Resource Types ​

By default, metrics for all supported resource types are collected. To enable or disable the collection of metrics for a specific resource, use the resources section in the runtime input.

The following example collects only DaemonSet, Deployment, StatefulSet, and Job metrics:

yaml
...
  input:
    runtime:
      enabled: true
      resources:
        pod:
          enabled: false
        container:
          enabled: false
        node:
          enabled: false
        volume:
          enabled: false
        daemonset:
          enabled: true
        deployment:
          enabled: true
        statefulset:
          enabled: true
        job:
          enabled: true

See a summary of the types of information you can gather for each resource:

ResourceMetrics Collected
podCPU, memory, filesystem, and network usage; current Pod phase
containerCPU/memory requests, limits, and usage; container restart count
nodeAggregated CPU, memory, filesystem, and network usage for the Node
volumeFilesystem capacity, usage, and inode statistics for persistent volumes
deploymentNumber of desired versus available replicas
daemonsetNumber of desired, current, and ready Nodes
statefulsetNumber of desired, current, and ready Pods
jobCounts of active, successful, and failed Pods

To learn which specific metrics are collected from which source (kubletstatsreceiver or k8sclusterreceiver), see Runtime Metrics.