Skip to content

Commit

Permalink
Merge pull request #16189 from newrelic/dashboard-template-variables-…
Browse files Browse the repository at this point in the history
…update

chore(Dashboards): Adding template variable content
  • Loading branch information
jeff-colucci authored Feb 16, 2024
2 parents b8bd27a + 057701a commit 3375fd2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ import dashboardsAddWidgetAparse from 'images/dashboards_screenshot-crop_add-wid

import dashboardsAddWidgetCapture from 'images/dashboards_screenshot-crop_add-widget-capture.webp'

import dashboardsExampleTimePicker from 'images/dashboards_screenshot-crop_example-time-picker.webp'

import dashboardsExampleForm from 'images/dashboards_screenshot-crop_example-form.webp'


For custom dashboards, you can use **template variables** to dynamically filter charts and other widgets. Template variables help make your dashboards more useful, and help you more easily create dashboards you can reuse for different use cases.

Expand Down Expand Up @@ -199,6 +203,16 @@ There are three options:
</td>
</tr>

<tr>
<td>
Ignore time picker
</td>

<td>
Optional. Only present for query type. By turning this option off, the query will be run using the selected time picker’s value in the dashboard. That way, when the value of the time picker changes, the results of the variable’s dropdown will dynamically respond to the new selected time range.
</td>
</tr>

<tr>
<td>
Multi-select
Expand Down Expand Up @@ -280,6 +294,10 @@ To create a widget:
src={dashboardsExampleAddWidget}
/>

Notice that these are the NRQL clauses that will accept template variables as values: `SELECT`, `FROM`, `FACET`, `ORDER BY` and `WHERE`.

Instead, the following list of NRQL clauses will not accept template variables as arguments: `AS`, `COMPARE WITH`, `LIMIT`, `OFFSET`, `SINCE`, `SLIDE BY`, `TIMESERIES`, `UNTIL` and `WITH...`.

5. Click **Save**

</Collapser>
Expand Down Expand Up @@ -575,8 +593,40 @@ SELECT countryCode, city FROM PageAction WHERE countryCode IN ({{countryCode}})
src={dashboardsUseVariablesToFilter}
/>

</Collapser>

<Collapser
id="ignore-time-picker"
title="Use ignore time picker option"
>

By default the “ignore time picker” option is enabled, meaning that the query is always run using the default 1 `HOUR` time range value, even if the time picker in the dashboard has a different value selected (ex. 5 minutes, 3 hours, etc). The exception for that case is when the query has an explicit time range set with a `SINCE` clause, like for example:

```sql
SELECT uniques(eventId)
FROM AjaxRequest
SINCE 5 minutes ago
```
The results will be in the range of the last 5 minutes.

When the “ignore time picker” option is turned off, the query will run with the value selected in the time picker. For example, if you set the time picker to 30 minutes, such as in the screenshot below, in the form for editing the variables, the "ignore time picker" field will set to off.

<img
title="Example time picker"
alt="A screenshot showing the time picker"
src={dashboardsExampleTimePicker}
/>

This results in the values for the last 30 minutes. When you set the time picker value to **Default** and your query has a `SINCE` clause, the latest value will be used to run the query.

<img
title="Example form"
alt="A screenshot showing the variable form"
src={dashboardsExampleForm}
/>

</Collapser>

</CollapserGroup>

If you haven't already, create your free New Relic account below to start monitoring your data today.
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 3375fd2

Please sign in to comment.