I recently watched "A Practitioners Guide to “Dynatrace AppEngine: Everything thinkable is now possible”
. where Stefan Wassebauer did a technical demo of fetching dt.entity.service and getting the called and calling services. I thought I would replicate his work to cement my knowledge. Without the code and some of the DQL being off screen. I started with Notebooks in my environment to make sure I knew where to start.
This is the DQL that I ended up with:
fetch dt.entity.service
| fieldsAdd num_callers = arraySize(called_by[dt.entity.service]), num_called = arraySize(calls[dt.entity.service])
| filter num_callers > 1
| filter num_called > 1
| limit 20
when I added this to my code for app Engine
export default async function () {const result = await queryExecutionClient.queryExecute({body:{query: “fetch dt.entity.service | fieldsAdd num_callers = arraySize(called_by[dt.entity.service]), num_called = arraySize(calls[dt.entity.service]) | filter num_callers > 1 | filter num_called > 1 | limit 10”,requestTimeoutMilliseconds: 30000,},});I found that I was only getting 1 record returned, after a little experimenting with different DQLs including some Logs, I found I needed to add a “, from:now() - 100d” into my DQL, I am only a couple of months into working with Dynatrace and DQL is still new to me but I don’t understand why I would need a time range in my DQL when working with dt.entities. Can someone point me to the explanation of this? Code change to make it work export default async function () {const result = await queryExecutionClient.queryExecute({body:{query: “fetch dt.entity.service , from:now() - 100d | fieldsAdd num_callers = arraySize(called_by[dt.entity.service]), num_called = arraySize(calls[dt.entity.service]) | filter num_callers > 1 | filter num_called > 1 | limit 10”,requestTimeoutMilliseconds: 30000,},});