0
votes

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?

1

1 Answers

2
votes

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.