25 Oct 2024 05:38 PM
I am a novice. I'm sure the following problem arises from me not understanding the model, but I am not sure how to bridge the gap! Since the data I am looking at started from pre-defined measures, I would expect them to be consistent.
If I start from a container workload, open the CPU panel (with the basic CPU measures showing) in data explorer and then export the data, what I export does not match what I get when I export the percentage of limit.
There is one pod running 2 containers.
Date | CPU usage mCores | CPU throttling mCores | CPU limits mCores | CPU usage, % of limit | usage/limit (calculated) |
23/10/2024 16:58 | 13.5 | 12.5 | 600 | 3.57% | 2.25% |
23/10/2024 16:59 | 12.1 | 0.892 | 600 | 3.01% | 2.02% |
23/10/2024 17:00 | 395 | 1760 | 600 | 84.41% | 65.83% |
23/10/2024 17:01 | 430 | 1230 | 600 | 92.54% | 71.67% |
23/10/2024 17:02 | 347 | 676 | 600 | 76.70% | 57.83% |
where:
usage =
builtin:containers.cpu.usageMilliCores:filter(in("dt.entity.container_group_instance",entitySelector("type(CONTAINER_GROUP_INSTANCE),fromRelationships.IS_CGI_OF_CA(type(CLOUD_APPLICATION),entityId(CLOUD_APPLICATION-XXX))"))):parents:parents:splitBy("dt.entity.cloud_application"):sum
throttling =
builtin:containers.cpu.throttledMilliCores:filter(in("dt.entity.container_group_instance",entitySelector("type(CONTAINER_GROUP_INSTANCE),fromRelationships.IS_CGI_OF_CA(type(CLOUD_APPLICATION),type(CLOUD_APPLICATION),entityId(CLOUD_APPLICATION-XXX))"))):parents:parents:splitBy("dt.entity.cloud_application"):sum
limit =
builtin:kubernetes.workload.limits_cpu:filter(eq("dt.entity.cloud_application",CLOUD_APPLICATION-XXX)):splitBy("dt.entity.cloud_application"):sum
%age usage =
builtin:containers.cpu.usagePercent:filter(in("dt.entity.container_group_instance",entitySelector("type(CONTAINER_GROUP_INSTANCE),fromRelationships.IS_CGI_OF_CA(type(CLOUD_APPLICATION),type(CLOUD_APPLICATION),entityId(CLOUD_APPLICATION-XXX))"))):parents:parents:splitBy("dt.entity.cloud_application"):sum
25 Oct 2024 05:41 PM
I meant to add that I have the same problem with the memory measures, but it is probably the same knowledge gap!
28 Oct 2024 01:27 AM
Hi @manolan , you mentioned the pod contains two containers , so I guess the above metrics that you posted would be the pod level metrics (including two containers), right?
Can you please extract the same at the container level, separately for both containers inside the pod ?
Try comparing the metrics at both container (1+1) and pod level and you might find a clue.
28 Oct 2024 07:13 AM
@p_devulapalli I have no idea how to do that. I have tried a few things, but cannot get the different numbers to appear as series. Any hints?
Also, it is "sum" in both cases, so I would expect the raw numbers to be for all containers as well. So if that is the reason, I also need a suggestion for how to get the % usage at the pod level!