cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

V2 Metrics API - Can I get Kubernetes CPU requests for a pod?

crabbylou
Helper

Hello DT Community,

It seems that in the V2 Metrics API that there is no way to get pod CPU requests. I can get pod CPU usage, pod CPU limits, pod memory usage, pod memory limits, and pod memory requests. 

Is there a way to do this without doing a derived stat? Bigger question is there value in that stat?

Any advice is appreciated.

Thanks!

3 REPLIES 3

Mizső
DynaMight Guru
DynaMight Guru

Hi @crabbylou,

I have not seen any problem with the Metric API regarding CPU request of a POD.

I used this metric selector expression at the Metric API:

Mizs_4-1755817309404.png

Response part1:

 

Mizs_2-1755817005806.png

Response part2, this pod has 1 core cpu requests:

Mizs_3-1755817067048.png

Best regards,

János

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

Thanks for responding Mizso. Is there a way to get all the pods CPU requests for a namespace or workload?

The best I can get is the total. I cannot get it by pod name. The Classic UI graphs do a funky thing of taking the requests for the workload, and then divide by the number of running pods. 

I can do this in Grail, because they have an actual stat to do that, but I am still tied to the V2 API for now.

Thanks!

Hi @crabbylou,

Unfortunately I do not know soultion for this request.

Maybe the other community members have any ideas about it.

Best regards,

János 

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

Featured Posts