edselwang
edselwang

Reputation: 57

how to get kubernetes deployment CPU Usage by promethues

I built a promethues for my kubernetes, and it works well now. It can get node and container/pod cpu, memory data, but I don't know how to get the kubernetes CPU Usage in promethues. Because in my application, if pod restart, deployment will not get data before.

Upvotes: 0

Views: 1887

Answers (1)

coderanger
coderanger

Reputation: 54181

A deployment is only an abstraction within the Kubernetes control plane, the things actually using CPU will all be pods. So you can use something like this container_cpu_usage_seconds_total{namespace="mynamespace", pod_name=~"mydeployment-.*"}.

Upvotes: 2

Related Questions