Hi
I've deployed Metricbeat to my OpenShift environment along with kube-state-metrics as it's supposed to be used to get pod and container level metrics (such as CPU, RAM, IO etc). In documentation I read the kubernetes module gets state_pod metricset from kube-state-metrics.
I have default metricbeat-deployment-modules ConfigMap:
apiVersion: v1
data:
kubernetes.yml: |-
- module: kubernetes
metricsets:
- state_node
- state_deployment
- state_replicaset
- state_pod
- state_container
# Uncomment this to get k8s events:
#- event
period: 10s
hosts: ["kube-state-metrics:8080"]
kind: ConfigMap
metadata:
creationTimestamp: null
labels:
k8s-app: metricbeat
kubernetes.io/cluster-service: "true"
name: metricbeat-deployment-modules
In the events of Metricbeat I see events like following:
2018-04-20T08:00:06.581Z DEBUG [publish] pipeline/processor.go:275 Publish event: {
"@timestamp": "2018-04-20T08:00:06.568Z",
"@metadata": {
"beat": "metricbeat",
"type": "doc",
"version": "6.2.3"
},
"metricset": {
"rtt": 12430,
"namespace": "kubernetes.pod",
"name": "state_pod",
"module": "kubernetes",
"host": "kube-state-metrics:8080"
},
"kubernetes": {
"namespace": "default",
"pod": {
"name": "docker-registry-17-8zl0p",
"ip": "10.129.2.171",
"host_ip": "10.2.3.18",
"status": {
"phase": "running",
"ready": "true",
"scheduled": "true"
}
},
"node": {
"name": ""
}
},
"beat": {
"version": "6.2.3",
"name": "metricbeat-3335512447-7hq50",
"hostname": "metricbeat-3335512447-7hq50"
}
}
I expected to see much more fields in pod information as described here: https://www.elastic.co/guide/en/beats/metricbeat/6.2/exported-fields-kubernetes.html
I checked output of kube-state-metrics:8080/metrics and saw quite much of pod data returned:
# HELP kube_pod_container_requested_memory_bytes The number of requested memory bytes by a container.
# TYPE kube_pod_container_requested_memory_bytes gauge
kube_pod_container_requested_memory_bytes{container="curator",namespace="logging",node="inf-ph-openshift-node02.lan.local",pod="logging-curator-2-n7vdl"} 2.68435456e+08
kube_pod_container_requested_memory_bytes{container="elasticsearch",namespace="logging",node="inf-ph-openshift-node02.lan.local",pod="logging-es-data-master-zmmlgtku-2-fchgw"} 8.589934592e+09
kube_pod_container_requested_memory_bytes{container="fluentd-elasticsearch",namespace="logging",node="inf-ph-openshift-master01.lan.local",pod="logging-fluentd-q5pd2"} 5.36870912e+08
kube_pod_container_requested_memory_bytes{container="fluentd-elasticsearch",namespace="logging",node="inf-ph-openshift-master02.lan.local",pod="logging-fluentd-vd92p"} 5.36870912e+08
kube_pod_container_requested_memory_bytes{container="fluentd-elasticsearch",namespace="logging",node="inf-ph-openshift-master03.lan.local",pod="logging-fluentd-hdljn"} 5.36870912e+08
kube_pod_container_requested_memory_bytes{container="fluentd-elasticsearch",namespace="logging",node="inf-ph-openshift-node01.lan.local",pod="logging-fluentd-kksp0"} 5.36870912e+08
kube_pod_container_requested_memory_bytes{container="fluentd-elasticsearch",namespace="logging",node="inf-ph-openshift-node02.lan.local",pod="logging-fluentd-nwl6x"} 5.36870912e+08
kube_pod_container_requested_memory_bytes{container="kibana",namespace="logging",node="inf-ph-openshift-node02.lan.local",pod="logging-kibana-2-mnn22"} 7.71751936e+08
kube_pod_container_requested_memory_bytes{container="kibana-proxy",namespace="logging",node="inf-ph-openshift-node02.lan.local",pod="logging-kibana-2-mnn22"} 2.68435456e+08
kube_pod_container_requested_memory_bytes{container="metricbeat",namespace="logging",node="inf-ph-openshift-node01.lan.local",pod="metricbeat-3335512447-7hq50"} 1.048576e+08
kube_pod_container_requested_memory_bytes{container="registry",namespace="default",node="inf-ph-openshift-node02.lan.local",pod="docker-registry-17-8zl0p"} 2.68435456e+08
kube_pod_container_requested_memory_bytes{container="router",namespace="default",node="inf-ph-openshift-node01.lan.local",pod="router-19-v62t7"} 2.68435456e+08
kube_pod_container_requested_memory_bytes{container="router",namespace="default",node="inf-ph-openshift-node02.lan.local",pod="router-19-sbhkw"} 2.68435456e+08
However I'm not sure how this data is supposed to be mapped to fields published by Metricbeat. Should it be configured or it should be mapped and published by default?