DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there a way to get a list of all entity types in Grail (so something synonymous to the /entityTypes classic v2 API)?

36Krazyfists
Advisor

I know if I just start typing dt.entity. the auto-complete in the DQL query box will offer suggestions, but I want to be able to just get a list of all dt.entity.f5 types in a table.

 

The result I want would look like:

EntityTypeName

dt.entity.f5:gtm:pool

dt.entity.f5:gtm:virtual_server

dt.entity.f5:pool

and so on

 

Is this possible in Grail?  If so, how would that query look?

5 REPLIES 5

36Krazyfists
Advisor

Within 2 minutes of submitting this question I found the answer myself!

 

The answer is yes, there is a way to do this!

 

fetch dt.system.data_objects
| filter matchesValue(name, "dt.entity.f5*")

 

You can use that and replace the filter name value with whatever you want to get a list of current entities.

 

P.S. to Dynatrace Community website devs.  You should really add DQL/DPL in as valid languages for the "Insert/Edit code sample" formatting boxes on this site!  Would be really cool to have proper highlighting when people share those snippets!

@36Krazyfists How can i get entity types for self managed dynatrace, this DQL is not working in managed setup. 

@36Krazyfists How can i get entity types for self managed dynatrace, this DQL is not working in managed setup. 

Hi @skhamitkar ,

Just to avoid confusion:
As far as I know, Grail and DQL are currently available only in Dynatrace SaaS.
Dynatrace Managed does not support Grail datasets like dt.system.data_objects, so this query would not work there.

If the question is about Managed, we probably need a different approach (API-based, not DQL).

Could you please clarify which environment you are referring to?

Regards, Deni

Dynatrace Integration Engineer at CodeAttest

In Managed, you need an API call to get the entity types available in your environment - GET All Entity Types.

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

Featured Posts