# V2 Metrics API - How do I narrow the search to a certain Kubernetes namespace?

**URL:** <https://community.dynatrace.com/t/v2-metrics-api-how-do-i-narrow-the-search-to-a-certain-kubernetes-namespace/52920>\
**Category:** Dynatrace API\
**Tags:** dynatrace-managed, kubernetes, dynatrace-api\
**Created:** [August 12, 2025, 4:58pm UTC](https://community.dynatrace.com/t/v2-metrics-api-how-do-i-narrow-the-search-to-a-certain-kubernetes-namespace/52920 "2025-08-12T16:58:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crabbylou](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@crabbylou](https://community.dynatrace.com/u/crabbylou)\
**Post date:** [August 12, 2025, 4:58pm UTC](https://community.dynatrace.com/t/v2-metrics-api-how-do-i-narrow-the-search-to-a-certain-kubernetes-namespace/52920/1 "2025-08-12T16:58:14Z")

</div>

When I pull Kubernetes namespace statistics for containers and services, it works fine, howeverI would like to narrow the search to a particular Kubernetes workload name.

How do I do that??

I tried this, but it does not work: (Python example)

strKubernetesWorkloadClause = ‘,fromRelationship.isCgiOfCa(type(CLOUD\_APPLICATION),’ + \  
‘entityName.equals(~"’ + strInputKubernetesWorkload + ‘~"))’

Any help appreciated.

Lou

---

<div class="post-metadata">

**Author:** ![MichalGebacki](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michalgebacki/32/41585_2.png) [@MichalGebacki](https://community.dynatrace.com/u/MichalGebacki)\
**Post date:** [December 12, 2025, 1:51pm UTC](https://community.dynatrace.com/t/v2-metrics-api-how-do-i-narrow-the-search-to-a-certain-kubernetes-namespace/52920/2 "2025-12-12T13:51:50Z")

</div>

Hello,&nbsp;[@crabbylou](https://community.dynatrace.com/user/66964)!

Can you take a look at [**this Documentation page**](http://Settings%20API%20-%20Kubernetes%20namespace%20anomaly%20detection%20schema%20table) and let us know if is it helping in anyway to solve your challenge?

Thank you in advance for any feedback!
