• Home
  • Observe and explore
  • Dashboards
  • Dashboard tiles and filters
  • Add data to a dashboard

Add data to a dashboard

Latest Dynatrace

Add data

To Query Grail

  1. In the upper-right of the dashboard, open the Add menu and select Query Grail.

    Add tile button

    An Options side panel opens on the right.

  2. In the edit box, use the Dynatrace Query Language (DQL) to define your query.

  3. Select Run query to execute the DQL query and display visualization options.

  4. In the Result section, select Select visualization to choose a visualization format for your results.

    If a visualization is already selected, you can select Change visualization to select a different visualization.

    Change visualization

  5. Select < Options to return to the Options panel.

  6. In the Result section, select Customize… to adjust visualization settings as needed.

  7. Select < Options to return to the Options panel.

  8. Close the side panel when you're done.

Specify a custom timeframe

To specify a custom timeframe for your data tile such that it will ignore the one set in the upper-right corner of the dashboard, you can add your desired timeframe to your DQL query like:

dql
fetch [recordtype], from:now() - 2h | ....

For details regarding specifying a timeframe in DQL, see Specify timeframe in DQL documentation.

Data example 1

dql
fetch logs | summarize loglines = count(), by:{`1m interval` = bin(timestamp, 1m), status}

Data example 2

Create two variables

In case you haven't created a variable yet, first see Add a variable to a dashboard.

  1. Select Add variable and define the first variable.

    • Name: Hosts
    • Type: Query
    • Query:
      dql
      fetch logs | summarize count(), by:`dt.entity.host` | limit 100 | sort `count()`, direction:"descending" | fields `dt.entity.host`
    • Multi-select: turned on
  2. Select Add variable and define the second variable.

    • Name: Loglevel
    • Type: Query
    • Query:
      dql
      fetch logs, from:now() - 2h | summarize count(), by:loglevel | sort `count()`, direction:"descending" | fields loglevel
    • Multi-select: turned on

Add data

Now add data while referencing your previously created variables $LogLevel and $Hosts so that you can later use the variable filters on top of your dashboard to filter the tile according to your selections.

dql
fetch logs | filter in(loglevel,array($Loglevel)) | filter in(dt.entity.host, array($Hosts)) | summarize count(), by:{bin(timestamp, 1m)}

Select Run query.