﻿---
title: Kubernetes pod metrics
description: Learn about key Kubernetes pod metrics displayed in the Infrastructure UI: Kubernetes integration pod metrics, OpenTelemetry pod metrics. To analyze Kubernetes...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9070/reference/observability/observability-kubernetes-pod-metrics
products:
  - Elastic Cloud Serverless
  - Elastic Documentation
  - Elastic Observability
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# Kubernetes pod metrics
Learn about key Kubernetes pod metrics displayed in the Infrastructure UI:
- [Kubernetes integration pod metrics](#ecs-k8s-pod-metrics)
- [OpenTelemetry pod metrics](#otel-k8s-pod-metrics)

To analyze Kubernetes pod metrics, you can select view filters based on the following predefined metrics, or you can add [custom metrics](/elastic/docs-content/pull/9070/solutions/observability/infra-and-hosts/view-infrastructure-metrics-by-resource-type#custom-metrics).

## Kubernetes integration pod metrics

Refer to the following sections for pod metrics and field calculation formulas for Kubernetes integration data:
- [Entity definition](#monitor-k8s-pods-entity)
- [Metrics](#monitor-k8s-pods-metrics)

<note applies-to="Elastic Cloud Serverless: Removed, Elastic Stack: Planned for removal, Elastic Stack: Generally available from 9.3 to 9.5">
  For Kubernetes pod metrics, the [Infrastructure UI](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9070/solutions/observability/infra-and-hosts/analyze-infrastructure-host-metrics) and [inventory rules](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9070/solutions/observability/incident-management/create-an-inventory-rule) only support Kubernetes pod metric data collected by the [Kubernetes integration](https://docs-v3-preview.elastic.dev/elastic/integration-docs/tree/main/reference/kubernetes). If you're using Elastic OpenTelemetry and these views appear empty, refer to [Kubernetes Pods and Docker Containers views empty when using Elastic OpenTelemetry](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9070/troubleshoot/observability/troubleshooting-infrastructure-monitoring/kubernetes-pods-docker-containers-empty-otel).
</note>


### Entity definition

<applies-to>
  - Elastic Stack: Generally available since 9.3
</applies-to>

The following table lists the fields used to filter, identify, and display each pod entity.

|                   |                              |                                   |
|-------------------|------------------------------|-----------------------------------|
| **Filter**        | `event.module: "kubernetes"` | Used to filter relevant data.     |
| **Identifier**    | `kubernetes.pod.uid`         | Used to identify each entity.     |
| **Display value** | `kubernetes.pod.name`        | Used as a display friendly value. |


### Metrics

The following table lists each predefined pod metric and its field calculation formula.

| Metric               | Description                                                                                                                                                                                                                                                                                         |
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **CPU Usage**        | Percentage of CPU used, measured against the pod's CPU limit. When the pod has no CPU limit, the percentage is measured against the capacity of the node instead.**Field Calculation**: `average(kubernetes.pod.cpu.usage.limit.pct)`, falling back to `average(kubernetes.pod.cpu.usage.node.pct)` |
| **Memory Usage**     | Percentage of memory used, measured against the pod's memory limit. Pods without a memory limit report no value.**Field Calculation**: `average(kubernetes.pod.memory.usage.limit.pct)`                                                                                                             |
| **Inbound Traffic**  | Number of bytes received per second.**Field Calculation**: `derivative(max(kubernetes.pod.network.rx.bytes))` scaled to a 1 second rate                                                                                                                                                             |
| **Outbound Traffic** | Number of bytes sent per second.**Field Calculation**: `derivative(max(kubernetes.pod.network.tx.bytes))` scaled to a 1 second rate                                                                                                                                                                 |


## OpenTelemetry pod metrics

<applies-to>
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Planned
</applies-to>

The Infrastructure UI and inventory rules also support pod metrics collected using OpenTelemetry semantic conventions, through the `kubeletstats` receiver. To choose which pods you want to see, use the **Schema** menu described in [Select the data collection schema](/elastic/docs-content/pull/9070/solutions/observability/infra-and-hosts/view-infrastructure-metrics-by-resource-type#pod-schema-selector).
Refer to the following sections for pod metrics and field calculation formulas for OpenTelemetry data:
- [Entity definition](#opentelemetry-k8s-pod-entity)
- [Metrics](#otel-k8s-pod-metrics-list)


### OpenTelemetry Collector configuration

By default, when Elastic Agent is configured as an OTel Collector, it collects Kubernetes node, pod, and container metrics using the `kubeletstats` receiver. Refer to the [default Kubernetes configuration](https://docs-v3-preview.elastic.dev/elastic/elastic-agent/tree/main/reference/edot-collector/config/default-config-k8s) for the receiver settings.
If you're using a different Collector distribution or the upstream Contrib Collector, refer to the [Kubernetes OpenTelemetry Assets](https://docs-v3-preview.elastic.dev/elastic/integration-docs/tree/main/reference/kubernetes_otel) for the equivalent Collector configuration.

### Entity definition

The following table lists the fields used to filter, identify, and display each pod entity.

|                   |                                                    |                                   |
|-------------------|----------------------------------------------------|-----------------------------------|
| **Filter**        | `data_stream.dataset: 'kubeletstatsreceiver.otel'` | Used to filter relevant data.     |
| **Identifier**    | `k8s.pod.uid`                                      | Used to identify each entity.     |
| **Display value** | `k8s.pod.name`                                     | Used as a display friendly value. |


### Metrics

The following table lists each predefined pod metric and its field calculation formula.

| Metric               | Description                                                                                                                                                                                                                                                                                                                                                                   |
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **CPU Usage**        | Percentage of CPU used, measured against the pod's CPU limit. When the pod has no CPU limit, the percentage is measured against the capacity of the node instead.**Field Calculation**: `average(metrics.k8s.pod.cpu_limit_utilization)`, falling back to `average(metrics.k8s.pod.cpu.node.utilization)`                                                                     |
| **Memory Usage**     | Percentage of memory used, measured against the pod's memory limit. When the pod has no memory limit, the percentage is measured against the capacity of the node instead. If neither value is available, no value is reported.**Field Calculation**: `average(metrics.k8s.pod.memory_limit_utilization)`, falling back to `average(metrics.k8s.pod.memory.node.utilization)` |
| **Inbound Traffic**  | Number of bytes received per second. The maximum is taken for each network interface, then summed across interfaces.**Field Calculation**: `derivative(sum(max(metrics.k8s.pod.network.io, kql='direction: receive')))` scaled to a 1 second rate                                                                                                                             |
| **Outbound Traffic** | Number of bytes sent per second. The maximum is taken for each network interface, then summed across interfaces.**Field Calculation**: `derivative(sum(max(metrics.k8s.pod.network.io, kql='direction: transmit')))` scaled to a 1 second rate                                                                                                                                |

For information about the fields used by the Infrastructure UI to display Kubernetes pod metrics, see the [Infrastructure app fields](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9070/reference/observability/fields-and-object-schemas).