Hi,
I was trying to use Heapster to collect pod metrics and I did not specify sink for Heapster. The initial idea is to use Heapster metric model API get all metrics of a pod. But from the API specification and test, I did not see there is Heapster API which can return all the metrics, just like this
MetricSet: namespace:kube-system/pod:kubernetes-dashboard-v1.1.1-4cq9x
Scrape time: 2016-08-17 22:53:57.057958401 -0400 EDT 1471488837057958401
Create time: 2016-08-15 21:49:23.267586 -0400 EDT 1471312163267586000
Labels:
host_id = 9.21.60.67
hostname = 9.21.60.67
labels = k8s-app:kubernetes-dashboard,
kubernetes.io/cluster-service:true,version:v1.1.1 namespace_id = 0a6b2c6d-6353-11e6-b324-525400f5dfb2
namespace_name = kube-system
nodename = 9.21.60.67
pod_id = a4f64ee8-6353-11e6-b324-525400f5dfb2
pod_name = kubernetes-dashboard-v1.1.1-4cq9x
pod_namespace = kube-system
type = pod
Metrics:
cpu/limit = 100
cpu/request = 100
cpu/usage = 10298588
cpu/usage_rate = 1
memory/limit = 52428800
memory/major_page_faults = 1
memory/major_page_faults_rate = 0.000000
memory/page_faults = 160
memory/page_faults_rate = 0.000000
memory/request = 52428800
memory/usage = 12447744
memory/working_set = 5976064
network/rx = 8519194
network/rx_errors = 0
network/rx_errors_rate = 0.000000
network/rx_rate = 46.852867
network/tx = 18946258
network/tx_errors = 0
network/tx_errors_rate = 0.000000
network/tx_rate = 102.357391
uptime = 176681761
Labeled Metrics:
filesystem/usage = 40960
resource_id = /dev/mapper/ubu14042tmp--vg-root
filesystem/limit =
19145666560 resource_id = /dev/mapper/ubu14042tmp--vg-root
While from the Heapster API, I only can get one metric at a time,
# curl
http://k8s:8082/api/v1/model/namespaces/kube-system/pods/kubernetes-dashboard-v1.1.1-4cq9x/metrics/cpu/usage{
"metrics": [
{
"timestamp": "2016-08-17T22:51:00-04:00",
"value": 10298588
},
{
"timestamp": "2016-08-17T22:52:00-04:00",
"value": 10298588
},
{
"timestamp": "2016-08-17T22:53:00-04:00",
"value": 10298588
}
],
"latestTimestamp": "2016-08-17T22:53:00-04:00"
}
Is anyone know how to do?
Other question about Heapster:
I can not get filesystem metrics (filesystem/usage) from existing Heapster API. How can I get filesystem metrics of a pod?
What's exact meaning of the value of cpu/usage, memory/usage, filesystem/usage? Any reference?
Thanks
Liqiang Lin