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

cant retrieve id using classEntitySelector

noe131518
Newcomer_

In this page of the official documentation : DQL Best practices - Dynatrace Docs

The two exemple dont return the same fields, since first one also return the process group instance id. I was wondering how we could retrieve this id in the second exemple, i'm struggling to do it without overcomplicating the query.

1 REPLY 1

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

They also return different record sets. First example returns all host-PGI pairs matching condition (process is JAVA technology) while second example returns only host ID where there was at least one JAVA PGI running.

 

If you want to list all hosts (is and name) and PGIs (like in example 1), but use classicEntitySelector (which is better approach for now, as at it is usually faster), here is the query:

fetch dt.entity.process_group_instance
| filter in (id, classicEntitySelector("type(PROCESS_GROUP_INSTANCE),softwareTechnologies(JAVA)"))
| fieldsAdd dt.entity.host=belongs_to[dt.entity.host]
| fields id=dt.entity.host, entity.name=entityName(dt.entity.host), pgi=id

 

krzysztof_hoja_0-1731429345735.png

 

Featured Posts