16 Oct 2024 01:31 PM
Hi everyone,
I am running a DQL query that shows which services call other services and which are called by another. Below I leave the query and the result:
What I need to know is that if there is a way to show the names of the services and not the ID's of the services.
Thanks in advance
16 Oct 2024 04:44 PM
Hello @soportetr,
you can use lookup function:
fetch dt.entity.service
|fieldsAdd entity.customized_name
|fieldsAdd called_by,calls
|filter isNotNull(entity.customized_name)
|expand service1 = called_by[dt.entity.service]
|expand service2 = calls[dt.entity.service]
|fieldsAdd service1name = lookup([fetch dt.entity.service],
sourceField:service1 , lookupField:id)[entity.name]
|fieldsAdd service2name = lookup([fetch dt.entity.service],
sourceField:service2 , lookupField:id)[entity.name]
Best Regards
Michał
17 Oct 2024 02:20 AM
You could slightly simplify the above down using the entityName command. It would look something like:
fetch dt.entity.service
|fieldsAdd entity.customized_name
|fieldsAdd called_by,calls
|filter isNotNull(entity.customized_name)
|expand service1 = called_by[dt.entity.service]
|expand service2 = calls[dt.entity.service]
|fieldsAdd service1name = entityName(service1, type:"dt.entity.service")
|fieldsAdd service2name = entityName(service2, type:"dt.entity.service")
There is that command as well as entityAttr used for extracting entity attributes. Docs for which can be found here: https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/general-functions#...
17 Oct 2024 10:54 PM
Hi,
I have already managed to visualize the names of the services. But now it is showing duplicate data. I have tried using dedup, but it is still showing duplicate data.