Issues with API filter

I am really stuck - Trying to create a  filter for :

<span>dt.entity.cloud_application<br><br>This is the query that I'm trying to apply the filter for cloud application to.  This query returns all apps within a management zone.  Trying to filter by a single app or a list of apps.<br><br></span>
url = <span>'https://xxxxxx/e/xxxxx/api/v2/metrics/query?metricSelector=' </span>\<br>    <span>'(builtin:kubernetes.pods:last:splitBy("dt.entity.cloud_application"):sum:sort(value(avg,descending))):' </span>\<br>    <span>'names:fold(auto)&from=1739297079132&to=1739304279132&mzName=mzId(MBF)'</span>
<span>Can someone please provide me with the proper syntax for this API request?</span>

try  without quotes

https://xxxxxx/e/xxxxx/api/v2/metrics/query?metricSelector=(builtin:kubernetes.pods:last:splitBy("dt.entity.cloud_application"):sum:sort(value(avg,descending))):names:fold(auto)&from=1739297079132&to=1739304279132&mzName=mzId(MBF)

Sorry about that, my question wasn’t clear.  I fixed that.   What I’m looking for is a query where I can specify one or more apps.

Hey @CrazyHarry , did you manage to find the solution to your problem? If so, it would be amazing if you’ve shared it with the rest of the Community! If not, let me know, and I’ll look for some further assistance :blush:

Here is the solution:

url = “https://xxx.xxx/e/xxxxxx/api/v2/metrics/query?metricSelector=” \              “(builtin:kubernetes.workload.cpu_usage:filter(and(or(in(\“dt.entity.cloud_application_namespace\”,” \              “entitySelector(\“type(cloud_application_namespace),entityName.equals(~\”” + Namespace_user + “~\”)\“))))): " \                “splitBy(\“dt.entity.cloud_application\”):percentile(90.0):sort(value(percentile(90.0),descending))):” \                “names:fold(percentile(90)),” \                “(builtin:kubernetes.workload.pods_desired:filter(and(or(in(\“dt.entity.cloud_application_namespace\”,” \                “entitySelector(\“type(cloud_application_namespace),entityName.equals(~\”” + Namespace_user + “~\”)\”))))): " \              “splitBy(\“dt.entity.cloud_application\”):max:sort(value(max,descending))):names:fold(percentile(90)), " \              “(builtin:kubernetes.workload.memory_working_set:filter(and(or(in(\“dt.entity.cloud_application_namespace\”, " \              “entitySelector(\“type(cloud_application_namespace),entityName.equals(~\”” + Namespace_user + “~\”)\”))))):” \                “splitBy(\“dt.entity.cloud_application\”):percentile(90.0):sort(value(percentile(90.0),descending))):” \                “names:fold(percentile(90))&” \                “from=” + str(start_epoch_time)  + “&to=” + str(end_epoch_time)  + “&resolution=1m&mzSelector=mzName(” + MNE + “)”