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

How to optimize querying the Dynatrace API to retrieve information about process group instances

mrpoppler
Frequent Guest

I am retrieving process group instances using this kind of query: "/v2/entities?entitySelector=type(process_group_instance)&fields=toRelationships,fromRelationships,properties.metadata,properties.softwareTechnologies";

I am concerned that number of instances it returns is relatively large. 

Would be removal of Relationships help with response size? Are the Relationships mandatory to retrieve process group instances? If Relationships can not be removed then what would be query optimization suggestions? 

5 REPLIES 5

mark_bley
Dynatrace Champion
Dynatrace Champion

What is the goal ?

You can just pull pgis with entitySelector=type(process_group_instance) as parameter fields is optional.

If you want specific pgis extend the entitySelector with e.g. relationship to a Host, Host group, service, application...

type(PROCESS_GROUP_INSTANCE),fromRelationships.isProcessOf(type("HOST"),entityName("foo"))

Many possibilities...

The goal is to make the query faster.  So that result of the query becomes shorter yet it should be sufficient to retrieve entities like business applications. And idea is to remove toRelationships and fromRelationships for that from the query. 

mark_bley
Dynatrace Champion
Dynatrace Champion

I understand you want to make the query faster, was wondering what is the reason you need to export all the PGIs 🙂

As you noticed the number PGIs is quite huge so I would suggest reducing the fields to the necessary ones, and maybe extract more for specific entities afterwards.

 

Agreed, first of all, use entitySelector to query only process group instances you are interested in. (using management zone, process group properties, etc). Secondly select just fields you need.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

gopher
Mentor

Hi, 
 You can use the fields value to reduce what you pull down and or select
Monitored entities API - GET entity type - Dynatrace Docs

Example below :

 

params = {
    "entitySelector": 'type("Process_Group")',
    "fields": "properties.softwareTechnologies,fromRelationships,toRelationships,properties,tags",
    "Api-Token": "dt0c01."
}

 

Hope this helps

Featured Posts