diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 1ea8e34a199..1efd5bcba33 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -126,6 +126,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add new dashboard for VSphere host cluster and virtual machine {pull}14135[14135] - kubernetes.container.cpu.limit.cores and kubernetes.container.cpu.requests.cores are now floats. {issue}11975[11975] - Change types of numeric metrics from Kubelet summary api to double so as to cover big numbers. {pull}23335[23335] +- Add container.image.name and containe.name ECS fields for state_container. {pull}23802[23802] *Packetbeat* diff --git a/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.3.0.expected b/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.3.0.expected index 4d11be7adba..1e15d809ea5 100644 --- a/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.3.0.expected +++ b/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.3.0.expected @@ -2,7 +2,11 @@ { "RootFields": { "container": { - "id": "4beb9aab887ca162c9cb3534c4826156636241052cd548153eaa2a170b6d102f", + "id": "ab382dbe8f8265f88ee9fec7de142f778da4a5fd9fe0334e3bdb6fe851124c08", + "image": { + "name": "k8s.gcr.io/kube-addon-manager:v8.6" + }, + "name": "kube-addon-manager", "runtime": "docker" } }, @@ -12,18 +16,23 @@ "name": "minikube" }, "pod": { - "name": "kube-controller-manager-minikube" + "name": "kube-addon-manager-minikube" } }, "MetricSetFields": { "cpu": { "request": { - "cores": 0.2 + "cores": 0.005 } }, - "id": "docker://4beb9aab887ca162c9cb3534c4826156636241052cd548153eaa2a170b6d102f", - "image": "gcr.io/google_containers/kube-controller-manager-amd64:v1.9.7", - "name": "kube-controller-manager", + "id": "docker://ab382dbe8f8265f88ee9fec7de142f778da4a5fd9fe0334e3bdb6fe851124c08", + "image": "k8s.gcr.io/kube-addon-manager:v8.6", + "memory": { + "request": { + "bytes": 52428800 + } + }, + "name": "kube-addon-manager", "status": { "phase": "running", "ready": true, @@ -44,7 +53,11 @@ { "RootFields": { "container": { - "id": "c46bc2164edcb5972be6fc9174155e61179cb04314c4f6da5d25d3a76acadee6", + "id": "76c260259ddfd0267b5acb4e514465215ef1ebfa93a4057d592828772e6b39f5", + "image": { + "name": "gcr.io/google_containers/kube-proxy-amd64:v1.9.7" + }, + "name": "kube-proxy", "runtime": "docker" } }, @@ -54,13 +67,13 @@ "name": "minikube" }, "pod": { - "name": "kubernetes-dashboard-77d8b98585-vqtzm" + "name": "kube-proxy-znhg6" } }, "MetricSetFields": { - "id": "docker://c46bc2164edcb5972be6fc9174155e61179cb04314c4f6da5d25d3a76acadee6", - "image": "k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.1", - "name": "kubernetes-dashboard", + "id": "docker://76c260259ddfd0267b5acb4e514465215ef1ebfa93a4057d592828772e6b39f5", + "image": "gcr.io/google_containers/kube-proxy-amd64:v1.9.7", + "name": "kube-proxy", "status": { "phase": "running", "ready": true, @@ -81,7 +94,11 @@ { "RootFields": { "container": { - "id": "88951e0178ea5131fa3e2d7cafacb3a7e63700795dd6fa0d40ed2e4ac1f52f9c", + "id": "e9568dfef1dd249cabac4bf09e6bf4a239fe738ae20eba072b6516676fce4bf6", + "image": { + "name": "gcr.io/google_containers/kube-apiserver-amd64:v1.9.7" + }, + "name": "kube-apiserver", "runtime": "docker" } }, @@ -91,29 +108,18 @@ "name": "minikube" }, "pod": { - "name": "kube-state-metrics-6479d88c5c-5b6cl" + "name": "kube-apiserver-minikube" } }, "MetricSetFields": { "cpu": { - "limit": { - "cores": 0.101 - }, - "request": { - "cores": 0.101 - } - }, - "id": "docker://88951e0178ea5131fa3e2d7cafacb3a7e63700795dd6fa0d40ed2e4ac1f52f9c", - "image": "quay.io/coreos/kube-state-metrics:v1.3.0", - "memory": { - "limit": { - "bytes": 106954752 - }, "request": { - "bytes": 106954752 + "cores": 0.25 } }, - "name": "kube-state-metrics", + "id": "docker://e9568dfef1dd249cabac4bf09e6bf4a239fe738ae20eba072b6516676fce4bf6", + "image": "gcr.io/google_containers/kube-apiserver-amd64:v1.9.7", + "name": "kube-apiserver", "status": { "phase": "running", "ready": true, @@ -134,7 +140,11 @@ { "RootFields": { "container": { - "id": "948c4ebd8ca4fdf352e7fbf7f5c5d381af7e615ced435dc42fde0c1d25851320", + "id": "eadcbd54ba914dff6475ae64805887967cfb973aeb9b07364c94372658a71d11", + "image": { + "name": "gcr.io/google_containers/kube-scheduler-amd64:v1.9.7" + }, + "name": "kube-scheduler", "runtime": "docker" } }, @@ -144,29 +154,18 @@ "name": "minikube" }, "pod": { - "name": "kube-state-metrics-6479d88c5c-5b6cl" + "name": "kube-scheduler-minikube" } }, "MetricSetFields": { "cpu": { - "limit": { - "cores": 0.1 - }, "request": { "cores": 0.1 } }, - "id": "docker://948c4ebd8ca4fdf352e7fbf7f5c5d381af7e615ced435dc42fde0c1d25851320", - "image": "k8s.gcr.io/addon-resizer:1.7", - "memory": { - "limit": { - "bytes": 31457280 - }, - "request": { - "bytes": 31457280 - } - }, - "name": "addon-resizer", + "id": "docker://eadcbd54ba914dff6475ae64805887967cfb973aeb9b07364c94372658a71d11", + "image": "gcr.io/google_containers/kube-scheduler-amd64:v1.9.7", + "name": "kube-scheduler", "status": { "phase": "running", "ready": true, @@ -187,7 +186,11 @@ { "RootFields": { "container": { - "id": "1958e71d048065d38ce83dafda567c5fa9d0c1278cd7292d55b9f1d80b0a67f9", + "id": "88951e0178ea5131fa3e2d7cafacb3a7e63700795dd6fa0d40ed2e4ac1f52f9c", + "image": { + "name": "quay.io/coreos/kube-state-metrics:v1.3.0" + }, + "name": "kube-state-metrics", "runtime": "docker" } }, @@ -197,26 +200,29 @@ "name": "minikube" }, "pod": { - "name": "kube-dns-6f4fd4bdf-wlmht" + "name": "kube-state-metrics-6479d88c5c-5b6cl" } }, "MetricSetFields": { "cpu": { + "limit": { + "cores": 0.101 + }, "request": { - "cores": 0.1 + "cores": 0.101 } }, - "id": "docker://1958e71d048065d38ce83dafda567c5fa9d0c1278cd7292d55b9f1d80b0a67f9", - "image": "gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.7", + "id": "docker://88951e0178ea5131fa3e2d7cafacb3a7e63700795dd6fa0d40ed2e4ac1f52f9c", + "image": "quay.io/coreos/kube-state-metrics:v1.3.0", "memory": { "limit": { - "bytes": 178257920 + "bytes": 106954752 }, "request": { - "bytes": 73400320 + "bytes": 106954752 } }, - "name": "kubedns", + "name": "kube-state-metrics", "status": { "phase": "running", "ready": true, @@ -237,7 +243,11 @@ { "RootFields": { "container": { - "id": "76c260259ddfd0267b5acb4e514465215ef1ebfa93a4057d592828772e6b39f5", + "id": "1958e71d048065d38ce83dafda567c5fa9d0c1278cd7292d55b9f1d80b0a67f9", + "image": { + "name": "gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.7" + }, + "name": "kubedns", "runtime": "docker" } }, @@ -247,13 +257,26 @@ "name": "minikube" }, "pod": { - "name": "kube-proxy-znhg6" + "name": "kube-dns-6f4fd4bdf-wlmht" } }, "MetricSetFields": { - "id": "docker://76c260259ddfd0267b5acb4e514465215ef1ebfa93a4057d592828772e6b39f5", - "image": "gcr.io/google_containers/kube-proxy-amd64:v1.9.7", - "name": "kube-proxy", + "cpu": { + "request": { + "cores": 0.1 + } + }, + "id": "docker://1958e71d048065d38ce83dafda567c5fa9d0c1278cd7292d55b9f1d80b0a67f9", + "image": "gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.7", + "memory": { + "limit": { + "bytes": 178257920 + }, + "request": { + "bytes": 73400320 + } + }, + "name": "kubedns", "status": { "phase": "running", "ready": true, @@ -274,7 +297,11 @@ { "RootFields": { "container": { - "id": "f4cc07b8e7ee5952738c69a0bff0c7b331c10af66faa541197684127d393b760", + "id": "aad0addd205dc72dc7abc8f9d02a1b429a2f2e1df3acc60431ca6b79746c093b", + "image": { + "name": "gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.7" + }, + "name": "sidecar", "runtime": "docker" } }, @@ -284,17 +311,27 @@ "name": "minikube" }, "pod": { - "name": "storage-provisioner" + "name": "kube-dns-6f4fd4bdf-wlmht" } }, "MetricSetFields": { - "id": "docker://f4cc07b8e7ee5952738c69a0bff0c7b331c10af66faa541197684127d393b760", - "image": "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", - "name": "storage-provisioner", + "cpu": { + "request": { + "cores": 0.01 + } + }, + "id": "docker://aad0addd205dc72dc7abc8f9d02a1b429a2f2e1df3acc60431ca6b79746c093b", + "image": "gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.7", + "memory": { + "request": { + "bytes": 20971520 + } + }, + "name": "sidecar", "status": { "phase": "running", "ready": true, - "reason": "ImagePullBackOff", + "reason": "OOMKilled", "restarts": 0 } }, @@ -312,7 +349,11 @@ { "RootFields": { "container": { - "id": "e9568dfef1dd249cabac4bf09e6bf4a239fe738ae20eba072b6516676fce4bf6", + "id": "c46bc2164edcb5972be6fc9174155e61179cb04314c4f6da5d25d3a76acadee6", + "image": { + "name": "k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.1" + }, + "name": "kubernetes-dashboard", "runtime": "docker" } }, @@ -322,18 +363,13 @@ "name": "minikube" }, "pod": { - "name": "kube-apiserver-minikube" + "name": "kubernetes-dashboard-77d8b98585-vqtzm" } }, "MetricSetFields": { - "cpu": { - "request": { - "cores": 0.25 - } - }, - "id": "docker://e9568dfef1dd249cabac4bf09e6bf4a239fe738ae20eba072b6516676fce4bf6", - "image": "gcr.io/google_containers/kube-apiserver-amd64:v1.9.7", - "name": "kube-apiserver", + "id": "docker://c46bc2164edcb5972be6fc9174155e61179cb04314c4f6da5d25d3a76acadee6", + "image": "k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.1", + "name": "kubernetes-dashboard", "status": { "phase": "running", "ready": true, @@ -354,7 +390,11 @@ { "RootFields": { "container": { - "id": "eadcbd54ba914dff6475ae64805887967cfb973aeb9b07364c94372658a71d11", + "id": "4beb9aab887ca162c9cb3534c4826156636241052cd548153eaa2a170b6d102f", + "image": { + "name": "gcr.io/google_containers/kube-controller-manager-amd64:v1.9.7" + }, + "name": "kube-controller-manager", "runtime": "docker" } }, @@ -364,18 +404,18 @@ "name": "minikube" }, "pod": { - "name": "kube-scheduler-minikube" + "name": "kube-controller-manager-minikube" } }, "MetricSetFields": { "cpu": { "request": { - "cores": 0.1 + "cores": 0.2 } }, - "id": "docker://eadcbd54ba914dff6475ae64805887967cfb973aeb9b07364c94372658a71d11", - "image": "gcr.io/google_containers/kube-scheduler-amd64:v1.9.7", - "name": "kube-scheduler", + "id": "docker://4beb9aab887ca162c9cb3534c4826156636241052cd548153eaa2a170b6d102f", + "image": "gcr.io/google_containers/kube-controller-manager-amd64:v1.9.7", + "name": "kube-controller-manager", "status": { "phase": "running", "ready": true, @@ -396,7 +436,11 @@ { "RootFields": { "container": { - "id": "6e96fd8a687409b2314dcc01f209bb0c813c2fb08b8f75ad1695e120d41e1a2a", + "id": "f4cc07b8e7ee5952738c69a0bff0c7b331c10af66faa541197684127d393b760", + "image": { + "name": "gcr.io/k8s-minikube/storage-provisioner:v1.8.1" + }, + "name": "storage-provisioner", "runtime": "docker" } }, @@ -406,16 +450,17 @@ "name": "minikube" }, "pod": { - "name": "etcd-minikube" + "name": "storage-provisioner" } }, "MetricSetFields": { - "id": "docker://6e96fd8a687409b2314dcc01f209bb0c813c2fb08b8f75ad1695e120d41e1a2a", - "image": "gcr.io/google_containers/etcd-amd64:3.1.11", - "name": "etcd", + "id": "docker://f4cc07b8e7ee5952738c69a0bff0c7b331c10af66faa541197684127d393b760", + "image": "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "name": "storage-provisioner", "status": { "phase": "running", "ready": true, + "reason": "ImagePullBackOff", "restarts": 0 } }, @@ -433,7 +478,11 @@ { "RootFields": { "container": { - "id": "ab382dbe8f8265f88ee9fec7de142f778da4a5fd9fe0334e3bdb6fe851124c08", + "id": "e9560bbace13ca19de4b3771023198e8568f6b5ed6af3a949f10a5b8137b5be9", + "image": { + "name": "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.7" + }, + "name": "dnsmasq", "runtime": "docker" } }, @@ -443,23 +492,23 @@ "name": "minikube" }, "pod": { - "name": "kube-addon-manager-minikube" + "name": "kube-dns-6f4fd4bdf-wlmht" } }, "MetricSetFields": { "cpu": { "request": { - "cores": 0.005 + "cores": 0.15 } }, - "id": "docker://ab382dbe8f8265f88ee9fec7de142f778da4a5fd9fe0334e3bdb6fe851124c08", - "image": "k8s.gcr.io/kube-addon-manager:v8.6", + "id": "docker://e9560bbace13ca19de4b3771023198e8568f6b5ed6af3a949f10a5b8137b5be9", + "image": "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.7", "memory": { "request": { - "bytes": 52428800 + "bytes": 20971520 } }, - "name": "kube-addon-manager", + "name": "dnsmasq", "status": { "phase": "running", "ready": true, @@ -480,7 +529,11 @@ { "RootFields": { "container": { - "id": "aad0addd205dc72dc7abc8f9d02a1b429a2f2e1df3acc60431ca6b79746c093b", + "id": "948c4ebd8ca4fdf352e7fbf7f5c5d381af7e615ced435dc42fde0c1d25851320", + "image": { + "name": "k8s.gcr.io/addon-resizer:1.7" + }, + "name": "addon-resizer", "runtime": "docker" } }, @@ -490,27 +543,32 @@ "name": "minikube" }, "pod": { - "name": "kube-dns-6f4fd4bdf-wlmht" + "name": "kube-state-metrics-6479d88c5c-5b6cl" } }, "MetricSetFields": { "cpu": { + "limit": { + "cores": 0.1 + }, "request": { - "cores": 0.01 + "cores": 0.1 } }, - "id": "docker://aad0addd205dc72dc7abc8f9d02a1b429a2f2e1df3acc60431ca6b79746c093b", - "image": "gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.7", + "id": "docker://948c4ebd8ca4fdf352e7fbf7f5c5d381af7e615ced435dc42fde0c1d25851320", + "image": "k8s.gcr.io/addon-resizer:1.7", "memory": { + "limit": { + "bytes": 31457280 + }, "request": { - "bytes": 20971520 + "bytes": 31457280 } }, - "name": "sidecar", + "name": "addon-resizer", "status": { "phase": "running", "ready": true, - "reason": "OOMKilled", "restarts": 0 } }, @@ -528,7 +586,11 @@ { "RootFields": { "container": { - "id": "e9560bbace13ca19de4b3771023198e8568f6b5ed6af3a949f10a5b8137b5be9", + "id": "6e96fd8a687409b2314dcc01f209bb0c813c2fb08b8f75ad1695e120d41e1a2a", + "image": { + "name": "gcr.io/google_containers/etcd-amd64:3.1.11" + }, + "name": "etcd", "runtime": "docker" } }, @@ -538,23 +600,13 @@ "name": "minikube" }, "pod": { - "name": "kube-dns-6f4fd4bdf-wlmht" + "name": "etcd-minikube" } }, "MetricSetFields": { - "cpu": { - "request": { - "cores": 0.15 - } - }, - "id": "docker://e9560bbace13ca19de4b3771023198e8568f6b5ed6af3a949f10a5b8137b5be9", - "image": "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.7", - "memory": { - "request": { - "bytes": 20971520 - } - }, - "name": "dnsmasq", + "id": "docker://6e96fd8a687409b2314dcc01f209bb0c813c2fb08b8f75ad1695e120d41e1a2a", + "image": "gcr.io/google_containers/etcd-amd64:3.1.11", + "name": "etcd", "status": { "phase": "running", "ready": true, diff --git a/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.8.0.expected b/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.8.0.expected index 613fb647357..a3573c1a043 100644 --- a/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.8.0.expected +++ b/metricbeat/module/kubernetes/state_container/_meta/test/ksm.v1.8.0.expected @@ -2,7 +2,11 @@ { "RootFields": { "container": { - "id": "c152296116c064db311061cf6c39cff2de8d66339c954505cb68816464cf4a03", + "id": "cdaefb4df2f2add498f884fdc717a6ca8d2681c1636934747de600e6427e0c0d", + "image": { + "name": "k8s.gcr.io/kube-apiserver:v1.16.2" + }, + "name": "kube-apiserver", "runtime": "docker" } }, @@ -12,13 +16,18 @@ "name": "minikube" }, "pod": { - "name": "kube-proxy-dwg6l" + "name": "kube-apiserver-minikube" } }, "MetricSetFields": { - "id": "docker://c152296116c064db311061cf6c39cff2de8d66339c954505cb68816464cf4a03", - "image": "k8s.gcr.io/kube-proxy:v1.16.2", - "name": "kube-proxy", + "cpu": { + "request": { + "cores": 0.25 + } + }, + "id": "docker://cdaefb4df2f2add498f884fdc717a6ca8d2681c1636934747de600e6427e0c0d", + "image": "k8s.gcr.io/kube-apiserver:v1.16.2", + "name": "kube-apiserver", "status": { "phase": "running", "ready": true, @@ -39,7 +48,11 @@ { "RootFields": { "container": { - "id": "cdaefb4df2f2add498f884fdc717a6ca8d2681c1636934747de600e6427e0c0d", + "id": "f13c53a3ed0f3626b33b3c588d6913257320f65714eff28f25ead8f7663dc93b", + "image": { + "name": "k8s.gcr.io/kube-addon-manager:v9.0.2" + }, + "name": "kube-addon-manager", "runtime": "docker" } }, @@ -49,18 +62,23 @@ "name": "minikube" }, "pod": { - "name": "kube-apiserver-minikube" + "name": "kube-addon-manager-minikube" } }, "MetricSetFields": { "cpu": { "request": { - "cores": 0.25 + "cores": 0.005 } }, - "id": "docker://cdaefb4df2f2add498f884fdc717a6ca8d2681c1636934747de600e6427e0c0d", - "image": "k8s.gcr.io/kube-apiserver:v1.16.2", - "name": "kube-apiserver", + "id": "docker://f13c53a3ed0f3626b33b3c588d6913257320f65714eff28f25ead8f7663dc93b", + "image": "k8s.gcr.io/kube-addon-manager:v9.0.2", + "memory": { + "request": { + "bytes": 52428800 + } + }, + "name": "kube-addon-manager", "status": { "phase": "running", "ready": true, @@ -81,7 +99,11 @@ { "RootFields": { "container": { - "id": "2e0519a3fcd62acea8f4253b994ce53356d89171c0eb0920a13fe58b637d8cdb", + "id": "0ea0cef8a79c7643474a736e5da14c254d9411d87167028fa07c96d09748c83a", + "image": { + "name": "k8s.gcr.io/kube-scheduler:v1.16.2" + }, + "name": "kube-scheduler", "runtime": "docker" } }, @@ -91,13 +113,18 @@ "name": "minikube" }, "pod": { - "name": "kube-state-metrics-898d4db8d-dqmtg" + "name": "kube-scheduler-minikube" } }, "MetricSetFields": { - "id": "docker://2e0519a3fcd62acea8f4253b994ce53356d89171c0eb0920a13fe58b637d8cdb", - "image": "quay.io/coreos/kube-state-metrics:v1.8.0", - "name": "kube-state-metrics", + "cpu": { + "request": { + "cores": 0.1 + } + }, + "id": "docker://0ea0cef8a79c7643474a736e5da14c254d9411d87167028fa07c96d09748c83a", + "image": "k8s.gcr.io/kube-scheduler:v1.16.2", + "name": "kube-scheduler", "status": { "phase": "running", "ready": true, @@ -118,36 +145,27 @@ { "RootFields": { "container": { - "id": "15ada7864628d1c8007c01420e5887a501590d3bc9c25628a4770172ad615112", + "id": "a4cec783af3614b137f4b449eebf3ac61eaf0a8661cb2f4847741be5a24de0bf", + "image": { + "name": "k8s.gcr.io/nginx-slim:0.8" + }, + "name": "nginx", "runtime": "docker" } }, "ModuleFields": { - "namespace": "kube-system", + "namespace": "default", "node": { "name": "minikube" }, "pod": { - "name": "coredns-5644d7b6d9-k6wsp" + "name": "web-0" } }, "MetricSetFields": { - "cpu": { - "request": { - "cores": 0.1 - } - }, - "id": "docker://15ada7864628d1c8007c01420e5887a501590d3bc9c25628a4770172ad615112", - "image": "k8s.gcr.io/coredns:1.6.2", - "memory": { - "limit": { - "bytes": 178257920 - }, - "request": { - "bytes": 73400320 - } - }, - "name": "coredns", + "id": "docker://a4cec783af3614b137f4b449eebf3ac61eaf0a8661cb2f4847741be5a24de0bf", + "image": "k8s.gcr.io/nginx-slim:0.8", + "name": "nginx", "status": { "phase": "running", "ready": true, @@ -168,23 +186,27 @@ { "RootFields": { "container": { - "id": "669cc415d86b872450deaada60c73cca387ca23a7b0f21c5b146467b95cf1f76", + "id": "842fbd62a0ab71b9ed9139edce3db502e9d81e545b9646daa3cde09f9986ab06", + "image": { + "name": "k8s.gcr.io/etcd:3.3.15-0" + }, + "name": "etcd", "runtime": "docker" } }, "ModuleFields": { - "namespace": "default", + "namespace": "kube-system", "node": { "name": "minikube" }, "pod": { - "name": "web-1" + "name": "etcd-minikube" } }, "MetricSetFields": { - "id": "docker://669cc415d86b872450deaada60c73cca387ca23a7b0f21c5b146467b95cf1f76", - "image": "k8s.gcr.io/nginx-slim:0.8", - "name": "nginx", + "id": "docker://842fbd62a0ab71b9ed9139edce3db502e9d81e545b9646daa3cde09f9986ab06", + "image": "k8s.gcr.io/etcd:3.3.15-0", + "name": "etcd", "status": { "phase": "running", "ready": true, @@ -205,7 +227,11 @@ { "RootFields": { "container": { - "id": "f8fe5be1dbb1931d702c89235c79965730cbcced7b0ced9895f6c54c1ae8e5c3", + "id": "465ebffafd7fc238a2fa2e764255efcbff88d5513f4c68f57d70932985428d12", + "image": { + "name": "k8s.gcr.io/kube-controller-manager:v1.16.2" + }, + "name": "kube-controller-manager", "runtime": "docker" } }, @@ -215,26 +241,18 @@ "name": "minikube" }, "pod": { - "name": "coredns-5644d7b6d9-fhwjd" + "name": "kube-controller-manager-minikube" } }, "MetricSetFields": { "cpu": { "request": { - "cores": 0.1 - } - }, - "id": "docker://f8fe5be1dbb1931d702c89235c79965730cbcced7b0ced9895f6c54c1ae8e5c3", - "image": "k8s.gcr.io/coredns:1.6.2", - "memory": { - "limit": { - "bytes": 178257920 - }, - "request": { - "bytes": 73400320 + "cores": 0.2 } }, - "name": "coredns", + "id": "docker://465ebffafd7fc238a2fa2e764255efcbff88d5513f4c68f57d70932985428d12", + "image": "k8s.gcr.io/kube-controller-manager:v1.16.2", + "name": "kube-controller-manager", "status": { "phase": "running", "ready": true, @@ -255,7 +273,11 @@ { "RootFields": { "container": { - "id": "f13c53a3ed0f3626b33b3c588d6913257320f65714eff28f25ead8f7663dc93b", + "id": "2e0519a3fcd62acea8f4253b994ce53356d89171c0eb0920a13fe58b637d8cdb", + "image": { + "name": "quay.io/coreos/kube-state-metrics:v1.8.0" + }, + "name": "kube-state-metrics", "runtime": "docker" } }, @@ -265,23 +287,13 @@ "name": "minikube" }, "pod": { - "name": "kube-addon-manager-minikube" + "name": "kube-state-metrics-898d4db8d-dqmtg" } }, "MetricSetFields": { - "cpu": { - "request": { - "cores": 0.005 - } - }, - "id": "docker://f13c53a3ed0f3626b33b3c588d6913257320f65714eff28f25ead8f7663dc93b", - "image": "k8s.gcr.io/kube-addon-manager:v9.0.2", - "memory": { - "request": { - "bytes": 52428800 - } - }, - "name": "kube-addon-manager", + "id": "docker://2e0519a3fcd62acea8f4253b994ce53356d89171c0eb0920a13fe58b637d8cdb", + "image": "quay.io/coreos/kube-state-metrics:v1.8.0", + "name": "kube-state-metrics", "status": { "phase": "running", "ready": true, @@ -302,7 +314,11 @@ { "RootFields": { "container": { - "id": "842fbd62a0ab71b9ed9139edce3db502e9d81e545b9646daa3cde09f9986ab06", + "id": "15ada7864628d1c8007c01420e5887a501590d3bc9c25628a4770172ad615112", + "image": { + "name": "k8s.gcr.io/coredns:1.6.2" + }, + "name": "coredns", "runtime": "docker" } }, @@ -312,13 +328,26 @@ "name": "minikube" }, "pod": { - "name": "etcd-minikube" + "name": "coredns-5644d7b6d9-k6wsp" } }, "MetricSetFields": { - "id": "docker://842fbd62a0ab71b9ed9139edce3db502e9d81e545b9646daa3cde09f9986ab06", - "image": "k8s.gcr.io/etcd:3.3.15-0", - "name": "etcd", + "cpu": { + "request": { + "cores": 0.1 + } + }, + "id": "docker://15ada7864628d1c8007c01420e5887a501590d3bc9c25628a4770172ad615112", + "image": "k8s.gcr.io/coredns:1.6.2", + "memory": { + "limit": { + "bytes": 178257920 + }, + "request": { + "bytes": 73400320 + } + }, + "name": "coredns", "status": { "phase": "running", "ready": true, @@ -339,7 +368,11 @@ { "RootFields": { "container": { - "id": "465ebffafd7fc238a2fa2e764255efcbff88d5513f4c68f57d70932985428d12", + "id": "c152296116c064db311061cf6c39cff2de8d66339c954505cb68816464cf4a03", + "image": { + "name": "k8s.gcr.io/kube-proxy:v1.16.2" + }, + "name": "kube-proxy", "runtime": "docker" } }, @@ -349,18 +382,13 @@ "name": "minikube" }, "pod": { - "name": "kube-controller-manager-minikube" + "name": "kube-proxy-dwg6l" } }, "MetricSetFields": { - "cpu": { - "request": { - "cores": 0.2 - } - }, - "id": "docker://465ebffafd7fc238a2fa2e764255efcbff88d5513f4c68f57d70932985428d12", - "image": "k8s.gcr.io/kube-controller-manager:v1.16.2", - "name": "kube-controller-manager", + "id": "docker://c152296116c064db311061cf6c39cff2de8d66339c954505cb68816464cf4a03", + "image": "k8s.gcr.io/kube-proxy:v1.16.2", + "name": "kube-proxy", "status": { "phase": "running", "ready": true, @@ -381,7 +409,11 @@ { "RootFields": { "container": { - "id": "a4cec783af3614b137f4b449eebf3ac61eaf0a8661cb2f4847741be5a24de0bf", + "id": "30216f9823ca7d3454987075dd7256b665b14b2333c9a6762b127b6378516609", + "image": { + "name": "busybox:latest" + }, + "name": "hello", "runtime": "docker" } }, @@ -391,16 +423,17 @@ "name": "minikube" }, "pod": { - "name": "web-0" + "name": "hello-1578512100-vr7wj" } }, "MetricSetFields": { - "id": "docker://a4cec783af3614b137f4b449eebf3ac61eaf0a8661cb2f4847741be5a24de0bf", - "image": "k8s.gcr.io/nginx-slim:0.8", - "name": "nginx", + "id": "docker://30216f9823ca7d3454987075dd7256b665b14b2333c9a6762b127b6378516609", + "image": "busybox:latest", + "name": "hello", "status": { - "phase": "running", - "ready": true, + "phase": "terminated", + "ready": false, + "reason": "Completed", "restarts": 0 } }, @@ -418,7 +451,11 @@ { "RootFields": { "container": { - "id": "e0b05fcb32abf937c395942e0234b5dfc834206149bbb95afa585c51693650f3", + "id": "f8fe5be1dbb1931d702c89235c79965730cbcced7b0ced9895f6c54c1ae8e5c3", + "image": { + "name": "k8s.gcr.io/coredns:1.6.2" + }, + "name": "coredns", "runtime": "docker" } }, @@ -428,13 +465,26 @@ "name": "minikube" }, "pod": { - "name": "storage-provisioner" + "name": "coredns-5644d7b6d9-fhwjd" } }, "MetricSetFields": { - "id": "docker://e0b05fcb32abf937c395942e0234b5dfc834206149bbb95afa585c51693650f3", - "image": "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", - "name": "storage-provisioner", + "cpu": { + "request": { + "cores": 0.1 + } + }, + "id": "docker://f8fe5be1dbb1931d702c89235c79965730cbcced7b0ced9895f6c54c1ae8e5c3", + "image": "k8s.gcr.io/coredns:1.6.2", + "memory": { + "limit": { + "bytes": 178257920 + }, + "request": { + "bytes": 73400320 + } + }, + "name": "coredns", "status": { "phase": "running", "ready": true, @@ -455,7 +505,11 @@ { "RootFields": { "container": { - "id": "30216f9823ca7d3454987075dd7256b665b14b2333c9a6762b127b6378516609", + "id": "669cc415d86b872450deaada60c73cca387ca23a7b0f21c5b146467b95cf1f76", + "image": { + "name": "k8s.gcr.io/nginx-slim:0.8" + }, + "name": "nginx", "runtime": "docker" } }, @@ -465,17 +519,16 @@ "name": "minikube" }, "pod": { - "name": "hello-1578512100-vr7wj" + "name": "web-1" } }, "MetricSetFields": { - "id": "docker://30216f9823ca7d3454987075dd7256b665b14b2333c9a6762b127b6378516609", - "image": "busybox:latest", - "name": "hello", + "id": "docker://669cc415d86b872450deaada60c73cca387ca23a7b0f21c5b146467b95cf1f76", + "image": "k8s.gcr.io/nginx-slim:0.8", + "name": "nginx", "status": { - "phase": "terminated", - "ready": false, - "reason": "Completed", + "phase": "running", + "ready": true, "restarts": 0 } }, @@ -493,7 +546,11 @@ { "RootFields": { "container": { - "id": "0ea0cef8a79c7643474a736e5da14c254d9411d87167028fa07c96d09748c83a", + "id": "e0b05fcb32abf937c395942e0234b5dfc834206149bbb95afa585c51693650f3", + "image": { + "name": "gcr.io/k8s-minikube/storage-provisioner:v1.8.1" + }, + "name": "storage-provisioner", "runtime": "docker" } }, @@ -503,18 +560,13 @@ "name": "minikube" }, "pod": { - "name": "kube-scheduler-minikube" + "name": "storage-provisioner" } }, "MetricSetFields": { - "cpu": { - "request": { - "cores": 0.1 - } - }, - "id": "docker://0ea0cef8a79c7643474a736e5da14c254d9411d87167028fa07c96d09748c83a", - "image": "k8s.gcr.io/kube-scheduler:v1.16.2", - "name": "kube-scheduler", + "id": "docker://e0b05fcb32abf937c395942e0234b5dfc834206149bbb95afa585c51693650f3", + "image": "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "name": "storage-provisioner", "status": { "phase": "running", "ready": true, diff --git a/metricbeat/module/kubernetes/state_container/_meta/testdata/ksm-v1_3_0.plain-expected.json b/metricbeat/module/kubernetes/state_container/_meta/testdata/ksm-v1_3_0.plain-expected.json index f8278f2106b..7e441d02a60 100644 --- a/metricbeat/module/kubernetes/state_container/_meta/testdata/ksm-v1_3_0.plain-expected.json +++ b/metricbeat/module/kubernetes/state_container/_meta/testdata/ksm-v1_3_0.plain-expected.json @@ -1,5 +1,13 @@ [ { + "container": { + "id": "e2ee1c2c7b8d4e5fd8c834b83cba8377d6b0e39da18157688ccc1a06b7c53117", + "image": { + "name": "jenkinsci/jenkins:2.46.1" + }, + "name": "wise-lynx-jenkins", + "runtime": "docker" + }, "event": { "dataset": "kubernetes.container", "duration": 115000, @@ -8,26 +16,30 @@ "kubernetes": { "container": { "cpu": { - "limit": { - "cores": 0.2 - }, "request": { - "cores": 0.1 + "cores": 0.2 } }, + "id": "docker://e2ee1c2c7b8d4e5fd8c834b83cba8377d6b0e39da18157688ccc1a06b7c53117", + "image": "jenkinsci/jenkins:2.46.1", "memory": { - "limit": { - "bytes": 52428800 - }, "request": { - "bytes": 31457280 + "bytes": 268435456 } }, - "name": "kube-state-metrics" + "name": "wise-lynx-jenkins", + "status": { + "phase": "running", + "ready": true, + "restarts": 1 + } + }, + "namespace": "jenkins", + "node": { + "name": "minikube" }, - "namespace": "kube-system", "pod": { - "name": "kube-state-metrics-1303537707-mnzbp" + "name": "wise-lynx-jenkins-1616735317-svn6k" } }, "metricset": { @@ -41,7 +53,11 @@ }, { "container": { - "id": "4fa227874ee68536bf902394fb662f07b99099798ca9cd5c1506b79075acc065", + "id": "3aaee8bdd311c015240e99fa2a5a5f2f26b11b51236a683b39d8c1902e423978", + "image": { + "name": "gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1" + }, + "name": "kubernetes-dashboard", "runtime": "docker" }, "event": { @@ -51,31 +67,21 @@ }, "kubernetes": { "container": { - "cpu": { - "request": { - "cores": 0.1 - } - }, - "id": "docker://4fa227874ee68536bf902394fb662f07b99099798ca9cd5c1506b79075acc065", - "image": "bitnami/redis:3.2.8-r2", - "memory": { - "request": { - "bytes": 268435456 - } - }, - "name": "jumpy-owl-redis", + "id": "docker://3aaee8bdd311c015240e99fa2a5a5f2f26b11b51236a683b39d8c1902e423978", + "image": "gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1", + "name": "kubernetes-dashboard", "status": { - "phase": "waiting", - "ready": false, - "restarts": 270 + "phase": "running", + "ready": true, + "restarts": 2 } }, - "namespace": "default", + "namespace": "kube-system", "node": { "name": "minikube" }, "pod": { - "name": "jumpy-owl-redis-3481028193-s78x9" + "name": "kubernetes-dashboard-vw0l6" } }, "metricset": { @@ -89,7 +95,11 @@ }, { "container": { - "id": "9a4c9462cd078d7be4f0a9b94bcfeb69d5fdd76bff67142df3f58367ac7e8d61", + "id": "469f5d2b7854eb52e5d13dc0cd3e664c1b682b157aabaf596ffe4984f1516902", + "image": { + "name": "gcr.io/kubernetes-helm/tiller:v2.3.1" + }, + "name": "tiller", "runtime": "docker" }, "event": { @@ -99,13 +109,13 @@ }, "kubernetes": { "container": { - "id": "docker://9a4c9462cd078d7be4f0a9b94bcfeb69d5fdd76bff67142df3f58367ac7e8d61", - "image": "gcr.io/google_containers/kube-dnsmasq-amd64:1.4", - "name": "dnsmasq", + "id": "docker://469f5d2b7854eb52e5d13dc0cd3e664c1b682b157aabaf596ffe4984f1516902", + "image": "gcr.io/kubernetes-helm/tiller:v2.3.1", + "name": "tiller", "status": { "phase": "running", "ready": true, - "restarts": 2 + "restarts": 1 } }, "namespace": "kube-system", @@ -113,7 +123,7 @@ "name": "minikube" }, "pod": { - "name": "kube-dns-v20-5g5cb" + "name": "tiller-deploy-3067024529-9lpmb" } }, "metricset": { @@ -127,7 +137,11 @@ }, { "container": { - "id": "973cbe45982c5126a5caf8c58d964c0ab1d5bb2c165ccc59715fcc1ebd58ab3d", + "id": "9a4c9462cd078d7be4f0a9b94bcfeb69d5fdd76bff67142df3f58367ac7e8d61", + "image": { + "name": "gcr.io/google_containers/kube-dnsmasq-amd64:1.4" + }, + "name": "dnsmasq", "runtime": "docker" }, "event": { @@ -137,29 +151,13 @@ }, "kubernetes": { "container": { - "cpu": { - "limit": { - "cores": 0.2 - }, - "request": { - "cores": 0.1 - } - }, - "id": "docker://973cbe45982c5126a5caf8c58d964c0ab1d5bb2c165ccc59715fcc1ebd58ab3d", - "image": "gcr.io/google_containers/kube-state-metrics:v0.4.1", - "memory": { - "limit": { - "bytes": 52428800 - }, - "request": { - "bytes": 31457280 - } - }, - "name": "kube-state-metrics", + "id": "docker://9a4c9462cd078d7be4f0a9b94bcfeb69d5fdd76bff67142df3f58367ac7e8d61", + "image": "gcr.io/google_containers/kube-dnsmasq-amd64:1.4", + "name": "dnsmasq", "status": { "phase": "running", "ready": true, - "restarts": 1 + "restarts": 2 } }, "namespace": "kube-system", @@ -167,7 +165,7 @@ "name": "minikube" }, "pod": { - "name": "kube-state-metrics-1303537707-7ncd1" + "name": "kube-dns-v20-5g5cb" } }, "metricset": { @@ -182,6 +180,10 @@ { "container": { "id": "fa3d83f648de42492b38fa3e8501d109376f391c50f2bd210c895c8477ae4b62", + "image": { + "name": "gcr.io/google_containers/kubedns-amd64:1.9" + }, + "name": "kubedns", "runtime": "docker" }, "event": { @@ -232,7 +234,11 @@ }, { "container": { - "id": "e2ee1c2c7b8d4e5fd8c834b83cba8377d6b0e39da18157688ccc1a06b7c53117", + "id": "4fa227874ee68536bf902394fb662f07b99099798ca9cd5c1506b79075acc065", + "image": { + "name": "bitnami/redis:3.2.8-r2" + }, + "name": "jumpy-owl-redis", "runtime": "docker" }, "event": { @@ -244,29 +250,29 @@ "container": { "cpu": { "request": { - "cores": 0.2 + "cores": 0.1 } }, - "id": "docker://e2ee1c2c7b8d4e5fd8c834b83cba8377d6b0e39da18157688ccc1a06b7c53117", - "image": "jenkinsci/jenkins:2.46.1", + "id": "docker://4fa227874ee68536bf902394fb662f07b99099798ca9cd5c1506b79075acc065", + "image": "bitnami/redis:3.2.8-r2", "memory": { "request": { "bytes": 268435456 } }, - "name": "wise-lynx-jenkins", + "name": "jumpy-owl-redis", "status": { - "phase": "running", - "ready": true, - "restarts": 1 + "phase": "waiting", + "ready": false, + "restarts": 270 } }, - "namespace": "jenkins", + "namespace": "default", "node": { "name": "minikube" }, "pod": { - "name": "wise-lynx-jenkins-1616735317-svn6k" + "name": "jumpy-owl-redis-3481028193-s78x9" } }, "metricset": { @@ -280,7 +286,11 @@ }, { "container": { - "id": "91fdd43f6b1b4c3dd133cfca53e0b1210bc557c2ae56006026b5ccdb5f52826f", + "id": "973cbe45982c5126a5caf8c58d964c0ab1d5bb2c165ccc59715fcc1ebd58ab3d", + "image": { + "name": "gcr.io/google_containers/kube-state-metrics:v0.4.1" + }, + "name": "kube-state-metrics", "runtime": "docker" }, "event": { @@ -291,22 +301,28 @@ "kubernetes": { "container": { "cpu": { + "limit": { + "cores": 0.2 + }, "request": { - "cores": 0.005 + "cores": 0.1 } }, - "id": "docker://91fdd43f6b1b4c3dd133cfca53e0b1210bc557c2ae56006026b5ccdb5f52826f", - "image": "gcr.io/google-containers/kube-addon-manager:v6.3", + "id": "docker://973cbe45982c5126a5caf8c58d964c0ab1d5bb2c165ccc59715fcc1ebd58ab3d", + "image": "gcr.io/google_containers/kube-state-metrics:v0.4.1", "memory": { - "request": { + "limit": { "bytes": 52428800 + }, + "request": { + "bytes": 31457280 } }, - "name": "kube-addon-manager", + "name": "kube-state-metrics", "status": { "phase": "running", "ready": true, - "restarts": 2 + "restarts": 1 } }, "namespace": "kube-system", @@ -314,7 +330,7 @@ "name": "minikube" }, "pod": { - "name": "kube-addon-manager-minikube" + "name": "kube-state-metrics-1303537707-7ncd1" } }, "metricset": { @@ -328,7 +344,11 @@ }, { "container": { - "id": "3aaee8bdd311c015240e99fa2a5a5f2f26b11b51236a683b39d8c1902e423978", + "id": "52fa55e051dc5b68e44c027588685b7edd85aaa03b07f7216d399249ff4fc821", + "image": { + "name": "gcr.io/google_containers/exechealthz-amd64:1.2" + }, + "name": "healthz", "runtime": "docker" }, "event": { @@ -338,9 +358,22 @@ }, "kubernetes": { "container": { - "id": "docker://3aaee8bdd311c015240e99fa2a5a5f2f26b11b51236a683b39d8c1902e423978", - "image": "gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1", - "name": "kubernetes-dashboard", + "cpu": { + "request": { + "cores": 0.01 + } + }, + "id": "docker://52fa55e051dc5b68e44c027588685b7edd85aaa03b07f7216d399249ff4fc821", + "image": "gcr.io/google_containers/exechealthz-amd64:1.2", + "memory": { + "limit": { + "bytes": 52428800 + }, + "request": { + "bytes": 52428800 + } + }, + "name": "healthz", "status": { "phase": "running", "ready": true, @@ -352,7 +385,7 @@ "name": "minikube" }, "pod": { - "name": "kubernetes-dashboard-vw0l6" + "name": "kube-dns-v20-5g5cb" } }, "metricset": { @@ -366,7 +399,11 @@ }, { "container": { - "id": "fa3d83f648de42492b38fa3e8501d109376f391c50f2bd210c895c8477ae4b62-test", + "id": "91fdd43f6b1b4c3dd133cfca53e0b1210bc557c2ae56006026b5ccdb5f52826f", + "image": { + "name": "gcr.io/google-containers/kube-addon-manager:v6.3" + }, + "name": "kube-addon-manager", "runtime": "docker" }, "event": { @@ -378,32 +415,29 @@ "container": { "cpu": { "request": { - "cores": 0.2 + "cores": 0.005 } }, - "id": "docker://fa3d83f648de42492b38fa3e8501d109376f391c50f2bd210c895c8477ae4b62-test", - "image": "gcr.io/google_containers/kubedns-amd64:1.9-test", + "id": "docker://91fdd43f6b1b4c3dd133cfca53e0b1210bc557c2ae56006026b5ccdb5f52826f", + "image": "gcr.io/google-containers/kube-addon-manager:v6.3", "memory": { - "limit": { - "bytes": 278257920 - }, "request": { - "bytes": 83400320 + "bytes": 52428800 } }, - "name": "kubedns", + "name": "kube-addon-manager", "status": { - "phase": "terminated", - "ready": false, - "restarts": 3 + "phase": "running", + "ready": true, + "restarts": 2 } }, - "namespace": "test", + "namespace": "kube-system", "node": { - "name": "minikube-test" + "name": "minikube" }, "pod": { - "name": "kube-dns-v20-5g5cb-test" + "name": "kube-addon-manager-minikube" } }, "metricset": { @@ -417,7 +451,11 @@ }, { "container": { - "id": "52fa55e051dc5b68e44c027588685b7edd85aaa03b07f7216d399249ff4fc821", + "id": "fa3d83f648de42492b38fa3e8501d109376f391c50f2bd210c895c8477ae4b62-test", + "image": { + "name": "gcr.io/google_containers/kubedns-amd64:1.9-test" + }, + "name": "kubedns", "runtime": "docker" }, "event": { @@ -429,32 +467,32 @@ "container": { "cpu": { "request": { - "cores": 0.01 + "cores": 0.2 } }, - "id": "docker://52fa55e051dc5b68e44c027588685b7edd85aaa03b07f7216d399249ff4fc821", - "image": "gcr.io/google_containers/exechealthz-amd64:1.2", + "id": "docker://fa3d83f648de42492b38fa3e8501d109376f391c50f2bd210c895c8477ae4b62-test", + "image": "gcr.io/google_containers/kubedns-amd64:1.9-test", "memory": { "limit": { - "bytes": 52428800 + "bytes": 278257920 }, "request": { - "bytes": 52428800 + "bytes": 83400320 } }, - "name": "healthz", + "name": "kubedns", "status": { - "phase": "running", - "ready": true, - "restarts": 2 + "phase": "terminated", + "ready": false, + "restarts": 3 } }, - "namespace": "kube-system", + "namespace": "test", "node": { - "name": "minikube" + "name": "minikube-test" }, "pod": { - "name": "kube-dns-v20-5g5cb" + "name": "kube-dns-v20-5g5cb-test" } }, "metricset": { @@ -468,8 +506,7 @@ }, { "container": { - "id": "469f5d2b7854eb52e5d13dc0cd3e664c1b682b157aabaf596ffe4984f1516902", - "runtime": "docker" + "name": "kube-state-metrics" }, "event": { "dataset": "kubernetes.container", @@ -478,21 +515,27 @@ }, "kubernetes": { "container": { - "id": "docker://469f5d2b7854eb52e5d13dc0cd3e664c1b682b157aabaf596ffe4984f1516902", - "image": "gcr.io/kubernetes-helm/tiller:v2.3.1", - "name": "tiller", - "status": { - "phase": "running", - "ready": true, - "restarts": 1 - } + "cpu": { + "limit": { + "cores": 0.2 + }, + "request": { + "cores": 0.1 + } + }, + "memory": { + "limit": { + "bytes": 52428800 + }, + "request": { + "bytes": 31457280 + } + }, + "name": "kube-state-metrics" }, "namespace": "kube-system", - "node": { - "name": "minikube" - }, "pod": { - "name": "tiller-deploy-3067024529-9lpmb" + "name": "kube-state-metrics-1303537707-mnzbp" } }, "metricset": { diff --git a/metricbeat/module/kubernetes/state_container/state_container.go b/metricbeat/module/kubernetes/state_container/state_container.go index 647fcff8b4f..3148e6d6cd6 100644 --- a/metricbeat/module/kubernetes/state_container/state_container.go +++ b/metricbeat/module/kubernetes/state_container/state_container.go @@ -134,18 +134,30 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) error { } // applying ECS to kubernetes.container.id in the form :// + // copy to ECS fields the kubernetes.container.image, kubernetes.container.name var rootFields common.MapStr + containerFields := common.MapStr{} if containerID, ok := event["id"]; ok { // we don't expect errors here, but if any we would obtain an // empty string cID := (containerID).(string) split := strings.Index(cID, "://") if split != -1 { - rootFields = common.MapStr{ - "container": common.MapStr{ - "runtime": cID[:split], - "id": cID[split+3:], - }} + containerFields.Put("runtime", cID[:split]) + containerFields.Put("id", cID[split+3:]) + } + } + if containerImage, ok := event["image"]; ok { + cImage := (containerImage).(string) + containerFields.Put("image.name", cImage) + } + if containerName, ok := event["name"]; ok { + cName := (containerName).(string) + containerFields.Put("name", cName) + } + if len(containerFields) > 0 { + rootFields = common.MapStr{ + "container": containerFields, } }