04 Nov 2024 01:01 PM
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.
12 Nov 2024 04:36 PM
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