24 Nov 2025 04:16 PM
I have written the following DQL and it works for my current use case but I was wondering about efficiency.
timeseries series = avg(dt.synthetic.http.availability),
by: { dt.entity.synthetic_test, dt.entity.synthetic_location, dt.entity.http_check },
filter: { contains(entityAttr(dt.entity.http_check, "entity.name"), "variable") }
| append [
timeseries series = avg(dt.synthetic.browser.availability),
by: { dt.entity.synthetic_test, dt.entity.synthetic_location },
filter: { contains(entityAttr(dt.entity.synthetic_test, "entity.name"), "variable") }
]
Is this the most efficient way to run this combined data set?
i have 2 questions.
1. In DQL can the variable be set as a variable and not a string that I have to modify in 2 places.
2. In DQL is there a more efficient way to combine the data. (Is append the best way?)
24 Nov 2025 08:56 PM
Hi,
Pure DQL does not support internal variables. You can define variables and use them when:
the query runs inside a Dashboard tile, or inside a Notebook with defined parameters.
In that case, $variableName gets substituted before execution.
Ad2. dt.synthetic.http.availability and dt.synthetic.browser.availability are two different metric keys.
Because they are stored separately, Dynatrace cannot fetch both in a single timeseries clause.
That means, You must run two metric queries and the correct way to combine the results is exactly what you did.
append works very efficiently for this scenario because it is just concatenating two independent result sets.There is no join, no correlation, no expensive pipeline step.