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

How to get container cpu or memory filter by namespace

Subhash
Visitor

I attempted to add the "Kubernetes Namespace" entity (dt.entity.cloud_application_namespace) for metric configuration, but the implementation is not working as expected.


builtin:containers.cpu.usagePercent:filter(in("dt.entity.container_group_instance",entitySelector("type(container_group_instance),fromRelationship.isCgiOfNamespace(type(CLOUD_APPLICATION_NAMESPACE))"))):splitBy("dt.entity.container_group_instance"):sort(value(auto,descending))


builtin:containers.memory.usagePercent:filter(in("dt.entity.container_group_instance",entitySelector("type(container_group_instance),fromRelationship.isCgiOfNamespace(type(CLOUD_APPLICATION_NAMESPACE))"))):splitBy("dt.entity.container_group_instance"):sort(value(auto,descending))

3 REPLIES 3

p_devulapalli
Leader

@Subhash It could be because below are the only dimensions that are available by default to split the metric  

 

p_devulapalli_0-1746664311045.png

More flexibility would be available via DQL/Grail but unfortunately associated Grail metrics does not seem to be available for these at this time.

You can still be able to query other relevant metrics CPU (Millicore) and split by namespace in DQL if you are interested

timeseries  avg(dt.kubernetes.container.cpu_usage), by:{k8s.namespace.name}

 

 

Phani Devulapalli

I am getting No metric found using the Metric Id "dt.kubernetes.container.cpu_usage". 

Screenshot 2025-05-07 at 6.14.25 PM.png

@Subhash That's a DQL query, you would need to run it in a Notebook

Phani Devulapalli

Featured Posts