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

Easily convert Data explorer queries to dql for Dashboards, Notebooks and other apps

dawid_rampalski
Dynatrace Guide
Dynatrace Guide

Why do I see differences in metric data between grail based queries and Data explorer?

With grail we have changed the way the data is stored and displayed. DQL allows you to access raw metric data and perform your own transformations to achieve what you want. In case of Data explorer it already does some processing on the data in the background. When trying to play around with timeseries in our new platform you might notice that metric results that you get differ from what you can see in Data explorer - this is most likely due to different processing applied by your query and by Data explorer

How do I get the same results?

To make transition from our classic Data explorer charts easier we have built a tool that will allow you to create a traditional metric query and automatically generate equivalent DQL command.

In Data explorer build your metric query:

dawid_rampalski_0-1707294491848.png

 

To transform it into dql, click on the "Open with" and select your application of choice:

dawid_rampalski_1-1707294975016.png

 

dawid_rampalski_2-1707295001837.png

 

Your query is generated in selected app together with a tile that runs it for you and presents results:

dawid_rampalski_3-1707295805465.png

 

 

 

timeseries usage=sum(dt.process.cpu.usage, rollup: avg), filter: { in(dt.entity.process_group_instance, classicEntitySelector("type(process_group_instance),fromRelationship.isProcessOf(type(HOST),entityName.equals(\"cpu1-demo1\"))")) }
| sort arraySum(usage) desc
| limit 20
| append [timeseries usage=avg(dt.host.cpu.usage), filter: { in(dt.entity.host, classicEntitySelector("type(host),entityName.equals(\"cpu1-demo1\")")) }
  | sort arrayAvg(usage) desc
  | limit 20]

 

 

 

This query is designed to provide the same processing that is selected in Data explorer or get as close to it as possible within DQL

7 REPLIES 7

dannemca
DynaMight Guru
DynaMight Guru

That's an interesting feature!!!

Site Reliability Engineer @ Kyndryl

DanielS
DynaMight Guru
DynaMight Guru

Great!!! Thanks. Very Useful

The true delight is in the finding out rather than in the knowing.

tijust1
Advisor

Ahh..thats awesome... very useful. Thanks for sharing this

Dynatrace Professional Certified

erh_inetum
Advisor

Hi @dawid_rampalski ,

In several cases we find this message when we try to convert a query from Data Explorer to DQL:

erh_inetum_0-1712898792825.png

Is it because there is not an equivalent metric for DQL?

The Data Explorer query that we can´t convert is using the following metrics:

  • builtin:apps.web.actionCount.load.browser
  • builtin:apps.web.actionCount.xhr.browse
  • builtin:apps.web.visuallyComplete.load.browse
  • builtin:apps.web.VisuallyComplete.xhr.browse

In these cases, how can we convert the DataExplorer query to DQL query?

 

Thanks in advance,

Elena.

Hi Elena,

that is exactly the reason why. We don't have metrics for applications enabled yet in Grail. You can check the list of currently available builtin metrics here: https://docs.dynatrace.com/docs/observe-and-explore/metrics/built-in-metrics-on-grail.

In the case of those there is at this point no way to use them from DQL. We are working on it though 🙂 

Best Regards,
Dawid

Thank you, this is a great help!

A Dynatrace Professional nerd working for Conclusion Xforce

cesarsaravia
Dynatrace Pro
Dynatrace Pro

Very useful tip!! 

-César S. - LATAM Solutions Architect

Featured Posts