DQL Dashboard Queries

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

you can create new metrics for this, and them they will be available on the grail

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

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.