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

error when adding Disks to Hosts limiting results

brandon_camp
Frequent Guest

My error is similar to this post that I don't see a resolution for: https://community.dynatrace.com/t5/DQL/DQL-Relationship-Query-returning-too-many-entity-IDs/m-p/2294...

I am running the DQL below which results in error: "The number of entity IDs in the relationship fields has been limited. Please try filtering or narrowing your timeframe."

fetch dt.entity.host
| fieldsAdd tags
| expand tags
| filter contains(tags, "Portfolio:")
| parse tags, """((LD:tag (!<<'\\' ':') LD:value)|LD:tag)"""
| filter value == $Portfolio
| fieldsRemove tags, tag, value
| fieldsAdd disks = contains[dt.entity.disk]
// the error happens for this operation above ^^^^
| expand disks
| fields disks

I tried increasing my Query Limits but no change in the error.

DQL objective:

  1. Get the Hosts and filter for any Hosts where Tag 'Portfolio:' equals the $Portfolio variable
  2. Get the Disks associated with the Host - adding the list of Disks is where the error occurs
  3. Expand each Disk into a row 

As soon as I expand disks the error occurs. In my environment for this scenario there are 417 Hosts matching the $Portfolio tag which then expands into at least 9,984 Disks (could be more due to error limits).

Any ideas how to get around this error limit?

2 REPLIES 2

marco_irmer
Champion

I think the workaround here would be to reverse the logic of the query, where you fetch dt.entity.disk and then use the belongs_to relationship to identify the host, before finally filtering on the portfolio value.

brandon_camp
Frequent Guest

Thanks Marco.  I reversed the DQL sequence and it does sidestep the error.  Updated logical sequence is now:

  1. Fetch all Disks and add Host Id field from belongs_to
  2. Join with nested fetch containing: all Hosts filtered for 'Portfolio' tag value equal to $Portfolio variable
  3. Tidy up fields in result

This then allowed me to get to my next stumbling block which I will post about separately.  Thanks!

 

Featured Posts