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

Formatting DQL Notebook Query into JSON for Dynatrace WebUI

Samaneh
Frequent Guest

Hi everyone,

I’m working with DQL in Dynatrace notebooks, and I need to format my query into a JSON payload for use in the Dynatrace WebUI. The challenge is that several characters—like double quotes ("), backslashes (\), and newlines (\n)—need to be escaped properly to make it valid JSON.

Is there a converter or tool available to automatically transform the DQL query (as written in a notebook) into the JSON-compatible format needed for WebUI queries?

If not, how do you typically handle this? I’m open to suggestions, such as scripts, tools, or best practices for efficiently managing this process.



Thank you in advance 

1 REPLY 1

Tiit_Hallas
Dynatrace Helper
Dynatrace Helper

There are two ways you could tackle this issue: 

1. When you execute your DQL query, you can set the display options (Options -> Visualization) to "raw response". That will display the whole Grail response in JSON format. Scrolling down to the "metadata" object you will find your DQL query in the JSON payload (see metadata.grail.query)

Tiit_Hallas_0-1732611580187.png

Tiit_Hallas_1-1732611684579.png

2. Copy your DQL into any JSON converter (e.g. https://jsontostring.com/) that will translate your payload to JSON-compatible string

I had a life once. Then I bought my first computer ...

Featured Posts