Prometheus : Expose kubernetes pod specific metrics

5/2/2019

How to expose pod level metrics (for example, CPU/memory usage) for a particular kubernetes pod running a docker container for prometheus? Does kubernetes has in built metric exposing or do I have to write an exporter by myself to expose pod level metrics and then host it at a specific port?

-- Jarvis
kubernetes
prometheus

1 Answer

5/2/2019

Starting from Kubernetes 1.8, resource usage metrics, such as container CPU and memory usage, are available in Kubernetes through the Metrics API

source: https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#the-metrics-api

If you want more pod specific metrics (let say that you want to collect java metrics like heap, gc and so on) you can use a prometheus exporter and scrape that info, but it all depends on the tech you want to use.

-- gonzalesraul
Source: StackOverflow