cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DQL Dashboard Queries

danielD
Dynatrace Helper
Dynatrace Helper

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

3 REPLIES 3

natanael_mendes
Champion

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

Dynatrace Professional Certified

gbaudart
Champion

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

Observability consultant - Dynatrace Associate Certified

rgarzon1
Advisor

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;
}

 

rgarzon1_0-1704956243727.png

 

PD: i just notice that this is from 3 months ago, but well you can always have new ways to doit. 

 

Featured Posts