Show service name on DQL Query

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

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ł

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: [General functions — Dynatrace Docs](General functions — Dynatrace Docs)

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.

Hi,

Have you tried using the fields command to specify the fields you only want to show?