03 Oct 2023 06:47 PM
Hello,
As I understand it not all Dynatrace metrics are currently in grail. For the metrics that are not, can you still use dql to query those metrics, for instance on the new dashboard app? Or do you have to create those tiles a different way?
Thank you
Solved! Go to Solution.
03 Oct 2023 10:46 PM
you can create new metrics for this, and them they will be available on the grail
10 Jan 2024 10:10 PM
Hi @danielD ,
The metrics and SLOs aren't available with grail.
To obtain them, you must use the SDK classic environment APIs, while waiting for these features to arrive natively in Grail.
It shouldn't be long
11 Jan 2024 06:58 AM
DanielD
You can use this in the notebooks or dashboards to get the metrics that you use in the dataexplorer
import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';
export default async function () {
const metricSelectorString = "builtin:service.response.time:splitBy():fold:avg";
const resp = await metricsClient.query({
metricSelector: metricSelectorString,
acceptType: "application/json; charset=utf-8",
});
let outarray = [];
for (let rate of resp.result[0].data) {
let i = 0;
for (let ts of rate.timestamps) {
i++;
let date = new Date(ts);
outarray.push({
'Timestamp': date,
'miliSeconds': rate.values/1000,
});
}
}
return outarray;
}
PD: i just notice that this is from 3 months ago, but well you can always have new ways to doit.