I am using powershell to execute but getting below error.
Metric selector parse warning: Metric selectors could only be parsed in backward compatibility mode. Consider querying `(builtin:tech.generic.count:splitBy(“‘dt.entity.process_group’”))` instead., The dimension key ‘dt.entity.process_group’ has been referenced, but the metric has no such key.
Query can be executed via the DQL API call also, with the /query: execute , with start/end you can play with the delta and get only the ones that have a delta against now()
I do not use powershell but I guess you should adapt ’ and " and ` correct expression in Powershell. This is an example about bash vs powershell differences:
Dynatrace API uses pagination concept. So, you have to adopt it in your script (you get next page key in the answer JSON). Theoretically you could define page size with pageSize=xxx, but you will need to know in advance how much PG’s you have (or pick it up from the API call as it is there in JSON too).