Search code examples
kubernetesheapster

No heapster filesystem metrics from REST API


I process a kubernetes proxy on my local machine through kubectl proxy. And I deployed heapster onto my kubernetes environment as well as influxdb and grafana. I can see the metrics of filesystem usage retrieved by grafana. enter image description here

However, I cannot get the filesystem usage through heapster REST API through: enter image description here

Please help me to check if there is any misconfigured or url wrong or other issue? Thanks.


Solution

  • In some pods there is no such type of metrics as filesystem/usage:

    Here is an example of available metrics list for etcd-minikube pod:

    http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/kube-system/pods/etcd-minikube/metrics/

    $ curl http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/kube-system/pods/etcd-minikube/metrics/ 
    
    [ 
      "network/rx_errors_rate", 
      "cpu/usage_rate", 
      "network/rx_errors", 
      "memory/request", 
      "memory/page_faults_rate", 
      "network/rx_rate", 
      "network/tx_errors_rate", 
      "memory/limit", 
      "network/rx", 
      "memory/major_page_faults_rate", 
      "uptime", 
      "memory/rss", 
      "memory/working_set", 
      "restart_count", 
      "network/tx_errors", 
      "cpu/request", 
      "cpu/limit", 
      "network/tx", 
      "memory/usage", 
      "network/tx_rate" 
     ] 
    

    In this example, there is no filesystem/usage in the list.

    If I try to get it, I'll get exactly the same result to the one you’ve posted in the question:

    http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/kube-system/pods/etcd-minikube/metrics/filesystem/usage

    $ curl http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/kube-system/pods/etcd-minikube/metrics/filesystem/usage 
    
    { 
      "metrics": [], 
      "latestTimestamp": "0001-01-01T00:00:00Z" 
     } 
    

    Therefore, check the available options for the pod using URL similar to the first example.