diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 92a79460b6a..fdbb36ad275 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -290,6 +290,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Add SSL support to mysql module {pull}37997[37997] - Add SSL support for aerospike module {pull}38126[38126] - Add last_terminated_timestamp metric in kubernetes module {pull}39200[39200] {issue}3802[3802] +- Add pod.status.ready_time and pod.status.reason metrics in kubernetes module {pull}39316[39316] *Metricbeat* diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index ca8f1185445..708d996f99d 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -46811,6 +46811,26 @@ type: keyword -- +*`kubernetes.pod.status.reason`*:: ++ +-- +The reason the pod is in its current state (Evicted, NodeAffinity, NodeLost, Shutdown or UnexpectedAdmissionError) + + +type: keyword + +-- + +*`kubernetes.pod.status.ready_time`*:: ++ +-- +Readiness achieved time in unix timestamp for a pod + + +type: double + +-- + [float] === replicaset diff --git a/metricbeat/module/kubernetes/_meta/test/KSM/ksm.v2.12.0.plain b/metricbeat/module/kubernetes/_meta/test/KSM/ksm.v2.12.0.plain index 35cf6a5ab8c..35b3f0e3aa0 100644 --- a/metricbeat/module/kubernetes/_meta/test/KSM/ksm.v2.12.0.plain +++ b/metricbeat/module/kubernetes/_meta/test/KSM/ksm.v2.12.0.plain @@ -1057,7 +1057,7 @@ kube_pod_status_container_ready_time{namespace="kube-system",pod="kube-scheduler kube_pod_status_container_ready_time{namespace="kube-system",pod="coredns-76f75df574-v8skx",uid="b02dd54a-7c6b-4a45-8f42-cbc00c6fb040"} 1.713862204e+09 # HELP kube_pod_status_reason The pod status reasons # TYPE kube_pod_status_reason gauge -kube_pod_status_reason{namespace="default",pod="web-0",uid="37dd3592-b439-4090-a233-49b8faa2b9b3",reason="Evicted"} 0 +kube_pod_status_reason{namespace="default",pod="web-0",uid="37dd3592-b439-4090-a233-49b8faa2b9b3",reason="Evicted"} 1 kube_pod_status_reason{namespace="default",pod="web-0",uid="37dd3592-b439-4090-a233-49b8faa2b9b3",reason="NodeAffinity"} 0 kube_pod_status_reason{namespace="default",pod="web-0",uid="37dd3592-b439-4090-a233-49b8faa2b9b3",reason="NodeLost"} 0 kube_pod_status_reason{namespace="default",pod="web-0",uid="37dd3592-b439-4090-a233-49b8faa2b9b3",reason="Shutdown"} 0 diff --git a/metricbeat/module/kubernetes/fields.go b/metricbeat/module/kubernetes/fields.go index 1c89d8a6235..36d93f81a8e 100644 --- a/metricbeat/module/kubernetes/fields.go +++ b/metricbeat/module/kubernetes/fields.go @@ -32,5 +32,5 @@ func init() { // AssetKubernetes returns asset data. // This is the base64 encoded zlib format compressed contents of module/kubernetes. func AssetKubernetes() string { - return "eJzsfd9y27iS932eAuWbL/nKo9rr1NapmnHO2eNNJuO1k5mLrS0FIiEJYwrgAKAdndqH38JfgiRAUiIoO7Z0MTWxre4fGo1Gd6PR+Anco/17cF+tECNIIP4GAIFFgd6Di4/uhxdvAMgRzxguBabkPfjbGwAAqP8A7JBgOJPfZqhAkKP3YAPfAMCREJhs+Hvw3xecFxeX4GIrRHnxP/J3W8rEMqNkjTfvwRoWHL0BYI1RkfP3isFPgMAdasGTH7EvJQdGq9L8JABPfq7JmrIdlD8GkOSACygwFzjjgK5BSXMOdpDADcrBau/xWRgKFo0jaCHBEnPEHhBzvwmh6kHWEuDPN9dAE/RkaT9NmdqPL6k2vB38k7LFA2IcU9L4CwvzHu0fKctbv+sBKz8S5Z1BKTkAw2ERBoHJ3CAkh34QDP1VIS4WDHFasQylw3GrKaMcBGm3AfBqNSeGGPkOjIyW6QEARRa8zYqKC8QuFVNewgxdOum868X1gNgqHax/fvlyAzok2zwzmicUheLZIdnlSQQiYikZpZ8Gg0GxAB0WbSw52y9ZlXBp/oHEFjEgtsjyABVHHORsD9qM2mDuMWlzm4DkIya5NPGG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3y96siKD8CwrQ/2xSQowvzCExoCJvbuQFo32X0fA+Q7U2Izi/wIAAP//LBrEPA==" } diff --git a/metricbeat/module/kubernetes/state_pod/_meta/data.json b/metricbeat/module/kubernetes/state_pod/_meta/data.json index 41ba094c58e..3d0dc66558b 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/data.json +++ b/metricbeat/module/kubernetes/state_pod/_meta/data.json @@ -6,17 +6,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "etcd-kind-control-plane", + "ip": "10.244.0.173", + "name": "hello-28564555-zdfjz", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } diff --git a/metricbeat/module/kubernetes/state_pod/_meta/fields.yml b/metricbeat/module/kubernetes/state_pod/_meta/fields.yml index 157ec4ec411..988851b7a6f 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/fields.yml +++ b/metricbeat/module/kubernetes/state_pod/_meta/fields.yml @@ -25,3 +25,11 @@ type: keyword description: > Kubernetes pod scheduled status (true, false, unknown) + - name: reason + type: keyword + description: > + The reason the pod is in its current state (Evicted, NodeAffinity, NodeLost, Shutdown or UnexpectedAdmissionError) + - name: ready_time + type: double + description: > + Readiness achieved time in unix timestamp for a pod diff --git a/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.10.0.plain.expected b/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.10.0.plain.expected index 1a6a2705b72..77419e6472e 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.10.0.plain.expected +++ b/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.10.0.plain.expected @@ -2,18 +2,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "local-path-storage", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-6bc4bddd6b-6vl7d", + "ip": "10.244.0.5", + "name": "kube-state-metrics-7857446fb4-x78j6", "status": { "phase": "running", "ready": "true", + "ready_time": 1698751133, "scheduled": "true" } }, @@ -39,10 +40,11 @@ "MetricSetFields": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "kube-proxy-2nq9k", + "name": "kube-scheduler-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675684, "scheduled": "true" } }, @@ -60,18 +62,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.8", - "name": "hello-mwrpw", + "ip": "172.18.0.2", + "name": "kube-controller-manager-kind-control-plane", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1698675686, "scheduled": "true" } }, @@ -96,11 +99,12 @@ }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.7", - "name": "fluentd-elasticsearch-m2tlp", + "ip": "10.244.0.3", + "name": "coredns-5d78c9869d-crtn9", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675701, "scheduled": "true" } }, @@ -125,8 +129,8 @@ }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.9", - "name": "hello-28312520-d5d5s", + "ip": "10.244.0.8", + "name": "hello-mwrpw", "status": { "phase": "succeeded", "ready": "false", @@ -154,11 +158,12 @@ }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.3", - "name": "coredns-5d78c9869d-crtn9", + "ip": "10.244.0.4", + "name": "coredns-5d78c9869d-gskzq", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675701, "scheduled": "true" } }, @@ -176,18 +181,18 @@ { "RootFields": null, "ModuleFields": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.4", - "name": "coredns-5d78c9869d-gskzq", + "ip": "10.244.0.9", + "name": "hello-28312520-d5d5s", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } }, @@ -213,10 +218,11 @@ "MetricSetFields": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "kube-scheduler-kind-control-plane", + "name": "kindnet-xg6gs", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675698, "scheduled": "true" } }, @@ -241,11 +247,12 @@ }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.5", - "name": "kube-state-metrics-7857446fb4-x78j6", + "ip": "10.244.0.7", + "name": "fluentd-elasticsearch-m2tlp", "status": { "phase": "running", "ready": "true", + "ready_time": 1698751174, "scheduled": "true" } }, @@ -271,10 +278,11 @@ "MetricSetFields": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "kube-controller-manager-kind-control-plane", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675692, "scheduled": "true" } }, @@ -300,10 +308,11 @@ "MetricSetFields": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "kindnet-xg6gs", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675692, "scheduled": "true" } }, @@ -321,18 +330,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "172.18.0.2", - "name": "kube-apiserver-kind-control-plane", + "ip": "10.244.0.6", + "name": "web-0", "status": { "phase": "running", "ready": "true", + "ready_time": 1698751165, "scheduled": "true" } }, @@ -350,18 +360,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "default", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.18.0.2", - "ip": "10.244.0.6", - "name": "web-0", + "ip": "10.244.0.2", + "name": "local-path-provisioner-6bc4bddd6b-6vl7d", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675701, "scheduled": "true" } }, @@ -387,10 +398,11 @@ "MetricSetFields": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "etcd-kind-control-plane", + "name": "kube-proxy-2nq9k", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675697, "scheduled": "true" } }, diff --git a/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.11.0.plain.expected b/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.11.0.plain.expected index 9dd8d1e7d41..13457ad1b49 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.11.0.plain.expected +++ b/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.11.0.plain.expected @@ -9,40 +9,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-controller-manager-kind-control-plane", - "status": { - "phase": "running", - "ready": "true", - "scheduled": "true" - } - }, - "Index": "", - "ID": "", - "Namespace": "kubernetes.pod", - "Timestamp": "0001-01-01T00:00:00Z", - "Error": null, - "Host": "", - "Service": "", - "Took": 0, - "Period": 0, - "DisableTimeSeries": false - }, - { - "RootFields": null, - "ModuleFields": { - "namespace": "kube-system", - "node": { - "name": "kind-control-plane" - } - }, - "MetricSetFields": { - "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kindnet-98xlt", + "ip": "10.244.0.4", + "name": "coredns-76f75df574-wfchs", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } }, @@ -89,18 +61,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.8", - "name": "web-0", + "ip": "172.21.0.2", + "name": "kube-proxy-45qj9", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862200, "scheduled": "true" } }, @@ -125,11 +98,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.40", - "name": "kube-state-metrics-cbc966f68-9kq2v", + "ip": "172.21.0.2", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862195, "scheduled": "true" } }, @@ -147,18 +121,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "local-path-storage", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-7577fdbbfb-wmdwd", + "ip": "172.21.0.2", + "name": "kube-scheduler-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862197, "scheduled": "true" } }, @@ -183,11 +158,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.4", - "name": "coredns-76f75df574-wfchs", + "ip": "172.21.0.2", + "name": "kube-controller-manager-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862193, "scheduled": "true" } }, @@ -205,18 +181,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "kube-system", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "etcd-kind-control-plane", + "ip": "10.244.0.2", + "name": "local-path-provisioner-7577fdbbfb-wmdwd", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } }, @@ -241,11 +218,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-apiserver-kind-control-plane", + "ip": "10.244.0.40", + "name": "kube-state-metrics-cbc966f68-9kq2v", "status": { "phase": "running", "ready": "true", + "ready_time": 1713879978, "scheduled": "true" } }, @@ -271,10 +249,11 @@ "MetricSetFields": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kube-proxy-45qj9", + "name": "kindnet-98xlt", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862201, "scheduled": "true" } }, @@ -357,11 +336,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.85", - "name": "mycurlpod", + "ip": "10.244.0.6", + "name": "fluentd-elasticsearch-l8b6x", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862304, "scheduled": "true" } }, @@ -415,11 +395,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.3", - "name": "coredns-76f75df574-v8skx", + "ip": "10.244.0.85", + "name": "mycurlpod", "status": { "phase": "running", "ready": "true", + "ready_time": 1713881941, "scheduled": "true" } }, @@ -444,11 +425,42 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.6", - "name": "fluentd-elasticsearch-l8b6x", + "ip": "172.21.0.2", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862189, + "scheduled": "true" + } + }, + "Index": "", + "ID": "", + "Namespace": "kubernetes.pod", + "Timestamp": "0001-01-01T00:00:00Z", + "Error": null, + "Host": "", + "Service": "", + "Took": 0, + "Period": 0, + "DisableTimeSeries": false + }, + { + "RootFields": null, + "ModuleFields": { + "namespace": "default", + "node": { + "name": "kind-control-plane" + } + }, + "MetricSetFields": { + "host_ip": "172.21.0.2", + "ip": "10.244.0.8", + "name": "web-0", + "status": { + "phase": "running", + "ready": "true", + "ready_time": 1713862311, "scheduled": "true" } }, @@ -473,11 +485,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-scheduler-kind-control-plane", + "ip": "10.244.0.3", + "name": "coredns-76f75df574-v8skx", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } }, diff --git a/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.12.0.plain.expected b/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.12.0.plain.expected index ff6eac9e4f0..dbe4a449707 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.12.0.plain.expected +++ b/metricbeat/module/kubernetes/state_pod/_meta/test/ksm.v2.12.0.plain.expected @@ -9,11 +9,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-controller-manager-kind-control-plane", + "ip": "10.244.0.4", + "name": "coredns-76f75df574-wfchs", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } }, @@ -39,10 +40,11 @@ "MetricSetFields": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kindnet-98xlt", + "name": "kube-proxy-45qj9", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862200, "scheduled": "true" } }, @@ -60,18 +62,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.8", - "name": "web-0", + "ip": "172.21.0.2", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862195, "scheduled": "true" } }, @@ -147,18 +150,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "local-path-storage", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-7577fdbbfb-wmdwd", + "ip": "172.21.0.2", + "name": "kube-scheduler-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862197, "scheduled": "true" } }, @@ -183,11 +187,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.174", - "name": "kube-state-metrics-5bcd4898-bntgt", + "ip": "172.21.0.2", + "name": "kube-controller-manager-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862193, "scheduled": "true" } }, @@ -205,18 +210,18 @@ { "RootFields": null, "ModuleFields": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.4", - "name": "coredns-76f75df574-wfchs", + "ip": "10.244.0.173", + "name": "hello-28564555-zdfjz", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } }, @@ -234,18 +239,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "default", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.173", - "name": "hello-28564555-zdfjz", + "ip": "10.244.0.2", + "name": "local-path-provisioner-7577fdbbfb-wmdwd", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } }, @@ -270,11 +276,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "etcd-kind-control-plane", + "ip": "10.244.0.174", + "name": "kube-state-metrics-5bcd4898-bntgt", "status": { "phase": "running", "ready": "true", + "ready_time": 1713873343, "scheduled": "true" } }, @@ -300,10 +307,11 @@ "MetricSetFields": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kube-apiserver-kind-control-plane", + "name": "kindnet-98xlt", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862201, "scheduled": "true" } }, @@ -321,18 +329,18 @@ { "RootFields": null, "ModuleFields": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-proxy-45qj9", + "ip": "10.244.0.7", + "name": "hello-wlb5q", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } }, @@ -350,18 +358,19 @@ { "RootFields": null, "ModuleFields": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.7", - "name": "hello-wlb5q", + "ip": "10.244.0.6", + "name": "fluentd-elasticsearch-l8b6x", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862304, "scheduled": "true" } }, @@ -379,18 +388,18 @@ { "RootFields": null, "ModuleFields": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" } }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.3", - "name": "coredns-76f75df574-v8skx", + "ip": "10.244.0.176", + "name": "hello-28564556-gkqsk", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } }, @@ -415,11 +424,13 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.176", - "name": "hello-28564556-gkqsk", + "ip": "10.244.0.8", + "name": "web-0", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862311, + "reason": "evicted", "scheduled": "true" } }, @@ -444,11 +455,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "10.244.0.6", - "name": "fluentd-elasticsearch-l8b6x", + "ip": "172.21.0.2", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862189, "scheduled": "true" } }, @@ -473,11 +485,12 @@ }, "MetricSetFields": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-scheduler-kind-control-plane", + "ip": "10.244.0.3", + "name": "coredns-76f75df574-v8skx", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } }, diff --git a/metricbeat/module/kubernetes/state_pod/_meta/testdata/docs.plain-expected.json b/metricbeat/module/kubernetes/state_pod/_meta/testdata/docs.plain-expected.json index 2f6d43d7933..92a365f6f2c 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/testdata/docs.plain-expected.json +++ b/metricbeat/module/kubernetes/state_pod/_meta/testdata/docs.plain-expected.json @@ -6,17 +6,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "etcd-kind-control-plane", + "ip": "10.244.0.173", + "name": "hello-28564555-zdfjz", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -37,17 +37,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.173", - "name": "hello-28564555-zdfjz", + "ip": "10.244.0.174", + "name": "kube-state-metrics-5bcd4898-bntgt", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713873343, "scheduled": "true" } } @@ -74,11 +75,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.4", - "name": "coredns-76f75df574-wfchs", + "ip": "172.21.0.2", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862195, "scheduled": "true" } } @@ -106,10 +108,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kindnet-98xlt", + "name": "kube-controller-manager-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862193, "scheduled": "true" } } @@ -130,17 +133,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-proxy-45qj9", + "ip": "10.244.0.2", + "name": "local-path-provisioner-7577fdbbfb-wmdwd", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -161,17 +165,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.172", - "name": "hello-28564554-llbsx", + "ip": "10.244.0.3", + "name": "coredns-76f75df574-v8skx", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -192,17 +197,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.3", - "name": "coredns-76f75df574-v8skx", + "ip": "10.244.0.172", + "name": "hello-28564554-llbsx", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -260,11 +265,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.6", - "name": "fluentd-elasticsearch-l8b6x", + "ip": "172.21.0.2", + "name": "kube-scheduler-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862197, "scheduled": "true" } } @@ -291,11 +297,11 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-scheduler-kind-control-plane", + "ip": "10.244.0.177", + "name": "mycurlpod", "status": { "phase": "running", - "ready": "true", + "ready": "false", "scheduled": "true" } } @@ -322,11 +328,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.177", - "name": "mycurlpod", + "ip": "10.244.0.6", + "name": "fluentd-elasticsearch-l8b6x", "status": { "phase": "running", - "ready": "false", + "ready": "true", + "ready_time": 1713862304, "scheduled": "true" } } @@ -347,17 +354,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.8", - "name": "web-0", + "ip": "10.244.0.4", + "name": "coredns-76f75df574-wfchs", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -385,10 +393,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kube-controller-manager-kind-control-plane", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862189, "scheduled": "true" } } @@ -409,17 +418,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.176", - "name": "hello-28564556-gkqsk", + "ip": "172.21.0.2", + "name": "kindnet-98xlt", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862201, "scheduled": "true" } } @@ -440,17 +450,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "local-path-storage", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-7577fdbbfb-wmdwd", + "ip": "10.244.0.8", + "name": "web-0", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862311, "scheduled": "true" } } @@ -471,17 +482,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-apiserver-kind-control-plane", + "ip": "10.244.0.176", + "name": "hello-28564556-gkqsk", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -508,11 +519,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.174", - "name": "kube-state-metrics-5bcd4898-bntgt", + "ip": "172.21.0.2", + "name": "kube-proxy-45qj9", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862200, "scheduled": "true" } } diff --git a/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.10.0.plain-expected.json b/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.10.0.plain-expected.json index 74de4188355..dbd86f44e72 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.10.0.plain-expected.json +++ b/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.10.0.plain-expected.json @@ -6,17 +6,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "10.244.0.6", - "name": "web-0", + "ip": "10.244.0.2", + "name": "local-path-provisioner-6bc4bddd6b-6vl7d", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675701, "scheduled": "true" } } @@ -48,6 +49,7 @@ "status": { "phase": "running", "ready": "true", + "ready_time": 1698675701, "scheduled": "true" } } @@ -68,17 +70,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "10.244.0.9", - "name": "hello-28312520-d5d5s", + "ip": "10.244.0.7", + "name": "fluentd-elasticsearch-m2tlp", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1698751174, "scheduled": "true" } } @@ -99,17 +102,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "172.18.0.2", - "name": "kube-apiserver-kind-control-plane", + "ip": "10.244.0.9", + "name": "hello-28312520-d5d5s", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -130,17 +133,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "10.244.0.8", - "name": "hello-mwrpw", + "ip": "172.18.0.2", + "name": "kube-scheduler-kind-control-plane", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1698675684, "scheduled": "true" } } @@ -161,17 +165,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "172.18.0.2", - "name": "kube-controller-manager-kind-control-plane", + "ip": "10.244.0.8", + "name": "hello-mwrpw", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -199,10 +203,11 @@ "pod": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "etcd-kind-control-plane", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675692, "scheduled": "true" } } @@ -223,17 +228,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "local-path-storage", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-6bc4bddd6b-6vl7d", + "ip": "172.18.0.2", + "name": "kindnet-xg6gs", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675698, "scheduled": "true" } } @@ -265,6 +271,7 @@ "status": { "phase": "running", "ready": "true", + "ready_time": 1698751133, "scheduled": "true" } } @@ -292,10 +299,11 @@ "pod": { "host_ip": "172.18.0.2", "ip": "172.18.0.2", - "name": "kube-scheduler-kind-control-plane", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675692, "scheduled": "true" } } @@ -322,11 +330,12 @@ }, "pod": { "host_ip": "172.18.0.2", - "ip": "172.18.0.2", - "name": "kindnet-xg6gs", + "ip": "10.244.0.4", + "name": "coredns-5d78c9869d-gskzq", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675701, "scheduled": "true" } } @@ -358,6 +367,7 @@ "status": { "phase": "running", "ready": "true", + "ready_time": 1698675697, "scheduled": "true" } } @@ -378,17 +388,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.18.0.2", - "ip": "10.244.0.7", - "name": "fluentd-elasticsearch-m2tlp", + "ip": "10.244.0.6", + "name": "web-0", "status": { "phase": "running", "ready": "true", + "ready_time": 1698751165, "scheduled": "true" } } @@ -415,11 +426,12 @@ }, "pod": { "host_ip": "172.18.0.2", - "ip": "10.244.0.4", - "name": "coredns-5d78c9869d-gskzq", + "ip": "172.18.0.2", + "name": "kube-controller-manager-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1698675686, "scheduled": "true" } } diff --git a/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.11.0.plain-expected.json b/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.11.0.plain-expected.json index cab0d7b67c3..c43a3d60599 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.11.0.plain-expected.json +++ b/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.11.0.plain-expected.json @@ -44,10 +44,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "etcd-kind-control-plane", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862195, "scheduled": "true" } } @@ -74,11 +75,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.4", - "name": "coredns-76f75df574-wfchs", + "ip": "172.21.0.2", + "name": "kube-controller-manager-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862193, "scheduled": "true" } } @@ -99,17 +101,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.85", - "name": "mycurlpod", + "ip": "10.244.0.2", + "name": "local-path-provisioner-7577fdbbfb-wmdwd", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -130,17 +133,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kindnet-98xlt", + "ip": "10.244.0.81", + "name": "hello-28564697-8dmzw", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -161,17 +164,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.81", - "name": "hello-28564697-8dmzw", + "ip": "10.244.0.3", + "name": "coredns-76f75df574-v8skx", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -192,17 +196,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-proxy-45qj9", + "ip": "10.244.0.7", + "name": "hello-wlb5q", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -229,11 +233,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.40", - "name": "kube-state-metrics-cbc966f68-9kq2v", + "ip": "172.21.0.2", + "name": "kube-scheduler-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862197, "scheduled": "true" } } @@ -254,17 +259,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.3", - "name": "coredns-76f75df574-v8skx", + "ip": "10.244.0.84", + "name": "hello-28564698-tv8jb", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -285,17 +290,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.7", - "name": "hello-wlb5q", + "ip": "10.244.0.6", + "name": "fluentd-elasticsearch-l8b6x", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862304, "scheduled": "true" } } @@ -322,11 +328,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.6", - "name": "fluentd-elasticsearch-l8b6x", + "ip": "10.244.0.4", + "name": "coredns-76f75df574-wfchs", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -354,10 +361,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kube-scheduler-kind-control-plane", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862189, "scheduled": "true" } } @@ -378,17 +386,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.84", - "name": "hello-28564698-tv8jb", + "ip": "172.21.0.2", + "name": "kindnet-98xlt", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862201, "scheduled": "true" } } @@ -420,6 +429,7 @@ "status": { "phase": "running", "ready": "true", + "ready_time": 1713862311, "scheduled": "true" } } @@ -446,11 +456,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-controller-manager-kind-control-plane", + "ip": "10.244.0.85", + "name": "mycurlpod", "status": { "phase": "running", "ready": "true", + "ready_time": 1713881941, "scheduled": "true" } } @@ -471,17 +482,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "local-path-storage", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-7577fdbbfb-wmdwd", + "ip": "10.244.0.40", + "name": "kube-state-metrics-cbc966f68-9kq2v", "status": { "phase": "running", "ready": "true", + "ready_time": 1713879978, "scheduled": "true" } } @@ -509,10 +521,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kube-apiserver-kind-control-plane", + "name": "kube-proxy-45qj9", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862200, "scheduled": "true" } } diff --git a/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.12.0.plain-expected.json b/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.12.0.plain-expected.json index 2f6d43d7933..884759e3d5f 100644 --- a/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.12.0.plain-expected.json +++ b/metricbeat/module/kubernetes/state_pod/_meta/testdata/ksm.v2.12.0.plain-expected.json @@ -6,17 +6,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "etcd-kind-control-plane", + "ip": "10.244.0.173", + "name": "hello-28564555-zdfjz", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -37,17 +37,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.173", - "name": "hello-28564555-zdfjz", + "ip": "10.244.0.174", + "name": "kube-state-metrics-5bcd4898-bntgt", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713873343, "scheduled": "true" } } @@ -74,11 +75,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.4", - "name": "coredns-76f75df574-wfchs", + "ip": "172.21.0.2", + "name": "kube-apiserver-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862195, "scheduled": "true" } } @@ -106,10 +108,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kindnet-98xlt", + "name": "kube-controller-manager-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862193, "scheduled": "true" } } @@ -130,17 +133,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "local-path-storage", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-proxy-45qj9", + "ip": "10.244.0.2", + "name": "local-path-provisioner-7577fdbbfb-wmdwd", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -161,17 +165,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.172", - "name": "hello-28564554-llbsx", + "ip": "10.244.0.3", + "name": "coredns-76f75df574-v8skx", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -192,17 +197,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.3", - "name": "coredns-76f75df574-v8skx", + "ip": "10.244.0.172", + "name": "hello-28564554-llbsx", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -260,11 +265,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.6", - "name": "fluentd-elasticsearch-l8b6x", + "ip": "172.21.0.2", + "name": "kube-scheduler-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862197, "scheduled": "true" } } @@ -291,11 +297,11 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-scheduler-kind-control-plane", + "ip": "10.244.0.177", + "name": "mycurlpod", "status": { "phase": "running", - "ready": "true", + "ready": "false", "scheduled": "true" } } @@ -322,11 +328,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.177", - "name": "mycurlpod", + "ip": "10.244.0.6", + "name": "fluentd-elasticsearch-l8b6x", "status": { "phase": "running", - "ready": "false", + "ready": "true", + "ready_time": 1713862304, "scheduled": "true" } } @@ -347,17 +354,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.8", - "name": "web-0", + "ip": "10.244.0.4", + "name": "coredns-76f75df574-wfchs", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862204, "scheduled": "true" } } @@ -385,10 +393,11 @@ "pod": { "host_ip": "172.21.0.2", "ip": "172.21.0.2", - "name": "kube-controller-manager-kind-control-plane", + "name": "etcd-kind-control-plane", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862189, "scheduled": "true" } } @@ -409,17 +418,18 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.176", - "name": "hello-28564556-gkqsk", + "ip": "172.21.0.2", + "name": "kindnet-98xlt", "status": { - "phase": "succeeded", - "ready": "false", + "phase": "running", + "ready": "true", + "ready_time": 1713862201, "scheduled": "true" } } @@ -440,17 +450,17 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "local-path-storage", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.2", - "name": "local-path-provisioner-7577fdbbfb-wmdwd", + "ip": "10.244.0.176", + "name": "hello-28564556-gkqsk", "status": { - "phase": "running", - "ready": "true", + "phase": "succeeded", + "ready": "false", "scheduled": "true" } } @@ -471,17 +481,19 @@ "module": "kubernetes" }, "kubernetes": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "kind-control-plane" }, "pod": { "host_ip": "172.21.0.2", - "ip": "172.21.0.2", - "name": "kube-apiserver-kind-control-plane", + "ip": "10.244.0.8", + "name": "web-0", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862311, + "reason": "evicted", "scheduled": "true" } } @@ -508,11 +520,12 @@ }, "pod": { "host_ip": "172.21.0.2", - "ip": "10.244.0.174", - "name": "kube-state-metrics-5bcd4898-bntgt", + "ip": "172.21.0.2", + "name": "kube-proxy-45qj9", "status": { "phase": "running", "ready": "true", + "ready_time": 1713862200, "scheduled": "true" } } diff --git a/metricbeat/module/kubernetes/state_pod/state_pod.go b/metricbeat/module/kubernetes/state_pod/state_pod.go index 4ec1f253893..7f6fb13eeca 100644 --- a/metricbeat/module/kubernetes/state_pod/state_pod.go +++ b/metricbeat/module/kubernetes/state_pod/state_pod.go @@ -27,10 +27,12 @@ import ( // mapping stores the state metrics we want to fetch and will be used by this metricset var mapping = &p.MetricsMapping{ Metrics: map[string]p.MetricMap{ - "kube_pod_info": p.InfoMetric(), - "kube_pod_status_phase": p.LabelMetric("status.phase", "phase", p.OpLowercaseValue()), - "kube_pod_status_ready": p.LabelMetric("status.ready", "condition", p.OpLowercaseValue()), - "kube_pod_status_scheduled": p.LabelMetric("status.scheduled", "condition", p.OpLowercaseValue()), + "kube_pod_info": p.InfoMetric(), + "kube_pod_status_phase": p.LabelMetric("status.phase", "phase", p.OpLowercaseValue()), + "kube_pod_status_ready": p.LabelMetric("status.ready", "condition", p.OpLowercaseValue()), + "kube_pod_status_scheduled": p.LabelMetric("status.scheduled", "condition", p.OpLowercaseValue()), + "kube_pod_status_reason": p.LabelMetric("status.reason", "reason", p.OpLowercaseValue()), + "kube_pod_status_ready_time": p.Metric("status.ready_time"), }, Labels: map[string]p.LabelMap{