

# Dashboards in Grafana version 9
<a name="v9-dashboards"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A dashboard is a set of one or more [panels](v9-panels.md) organized and arranged into one or more rows. Grafana ships with a variety of panels making it easy to construct the right queries, and customize the visualization so that you can create the perfect dashboard for your need. Each panel can interact with data from any configured [Connect to data sources](AMG-data-sources.md).

Dashboard snapshots are static. Queries and expressions cannot be re-run from snapshots. As a result, if you update any variables in your query or expression, it will not change your dashboard data.

**Topics**
+ [Using dashboards](v9-dash-using-dashboards.md)
+ [Building dashboards](v9-dash-building-dashboards.md)
+ [Managing dashboards](v9-dash-managing-dashboards.md)
+ [Sharing dashboards and panels](v9-dash-sharing.md)
+ [Managing playlists](v9-dash-managing-playlists.md)
+ [Adding and managing dashboard variables](v9-dash-variables.md)
+ [Assessing dashboard usage](v9-dash-assess-dashboard-usage.md)
+ [Searching Dashboards in Grafana version 9](v9-search.md)

# Using dashboards
<a name="v9-dash-using-dashboards"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

This topic provides an overview of dashboard features and shortcuts, and describes how to use dashboard search.

## Features
<a name="v9-dash-features"></a>

You can use dashboards to customize the presentation of your data in the following ways.


|  Feature  |  Description  | 
| --- | --- | 
| **1. Home** | Click the Grafana home icon to be redirected to the home page configured in the Grafana instance. | 
| **2. Title** | When you click the dashboard title, you can search for dashboard contained in the current folder. | 
| **3. Sharing a dashboard** | Use this option to share the current dashboard by link or snapshot. You can also export the dashboard definition from the share modal. | 
| **4. Adding a new panel** | Use this option to add a panel, dashboard row, or library panel to the current dashboard. | 
| **5. Dashboard settings** | Use this option to change dashboard name, folder, and tags and manage variables and annotation queries. For more information about dashboard settings, see [Modifying dashboard settings](v9-dash-modify-settings.md). | 
| **6. Time picker dropdown** |  Click to select relative time range options and set custom absolute time ranges. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-using-dashboards.html)  | 
| **7. Zooming out time range**  | Click to zoom out the time range. For more information about how to use time range controls, see [Setting dashboard time range](#v9-dash-setting-dashboard-time-range).  | 
| **8. Refreshing dashboard** | Click to immediately trigger queries and refresh dashboard data. | 
| **9. Refreshing dashboard time interval** | Click to select a dashboard auto refresh time interval. | 
| **10. View mode**  | Click to display the dashboard on a large screen such as a TV or a kiosk. View mode hides irrelevant information such as navigation menus.  | 
| **11. Dashboard panel** |  The primary building block of a dashboard is the panel. To add a new panel, dashboard row, or library panel, click **Add panel**. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-using-dashboards.html)  | 
| **12. Graph legend** | Change series colors, y-axis, and series visibility directly from the legend. | 
| **13. Dashboard search** | Click **Search** to search for dashboards by name or panel title. | 
| **14. Dashboard row** | A dashboard row is a logical divider within a dashboard that groups panels together. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-using-dashboards.html)  | 

## Keyboard shortcuts
<a name="v9-dash-keyboard-shortcuts"></a>

Grafana has a number of keyboard shortcuts available. To display all keyboard shortcuts available to you, press **?** or **h** on your keyboard.
+ `Ctrl+S` saves the current dashboard. 
+ `f` opens the dashboard finder/search. 
+  `d+k` toggles kiosk mode (hides the menu). 
+ `d+e` expands all rows. 
+ `d+s` opens dashboard settings. 
+ `Ctrl+K` opens the command palette.
+ `Esc` exits panel when in fullscreen view or edit mode. Also returns you to the dashboard from the dashboard settings.

**Focused panel**

To use shortcuts targeting a specific panel, hover over a panel with your pointer.
+ `e` toggles panel edit view 
+ `v` toggles panel fullscreen view 
+ `ps` opens panel share feature 
+ `pd` duplicates panel 
+ `pr` removes panel 
+ `pl` toggles panel legend 

## Setting dashboard time range
<a name="v9-dash-setting-dashboard-time-range"></a>

Grafana provides several ways to manage the time ranges of the data being visualized, for dashboard, panels and also for alerting.

This section describes supported time units and relative ranges, the common time controls, dashboard-wide time settings, and panel-specific time settings.

**Time units and relative ranges**

Grafana supports the following time units: `s (seconds)`, `m (minutes)`, `h (hours)`, `d (days)`, `w (weeks)`, `M (months)`, `Q (quarters)`, and `y (years)`. 

The minus operator enables you to step back in time, relative to now. If you want to display the full period of the unit (day, week, or month), append `/<time unit>` to the end. To view fiscal periods, use `fQ (fiscal quarter)` and `fy (fiscal year)` time units.

The plus operator enables you to step forward in time, relative to now. For example, you can use this feature to look at predicted data in the future.

The following table provides example relative ranges.


| Example relative range | From | To | 
| --- | --- | --- | 
| Last 5 minutes |  `now-5m`  |  `now`  | 
| The day so far |  `now/d`  |  `now`  | 
| This week |  `now/w`  |  `now/w`  | 
| This week so far |  `now/w`  |  `now`  | 
| This month |  `now/M`  |  `now/M`  | 
| This month so far |  `now/M`  |  `now`  | 
| Previous Month |  `now-1M/M`  |  `now-1M/M`  | 
| This year so far |  `now/Y`  |  `now`  | 
| This Year |  `now/Y`  |  `now/Y`  | 
| Previous fiscal year |  `now-1y/fy`  |  `now-1y/fy`  | 

**Note**  
 Grafana Alerting does not support `now+n` for future timestamps and `now-1n/n` for *start of n until end of n* timestamps. 

**Common time range controls**

The dashboard and panel time controls have a common user interface. The following describes common time range controls.
+ Current time range, also called the *time picker*, shows the time range currently displayed in the dashboard or panel you are viewing. Hover your cursor over the field to see the exact time stamps in the range and their source (such as the local browser). Click the *current time range* to change it. You can change the current time using a *relative time range*, such as the last 15 minutes, or an absolute time range, such as `2020-05-14 00:00:00` to `2020-05-15 23:59:59`.
+ The **relative time range** can be selected from the **Relative time ranges** list. You can filter the list using the input field at the top. Some examples of time ranges include *Last 30 minutes*, *Last 12 hours*, *Last 7 days*, *Last 2 years*, *Yesterday*, *Day before yesterday*, *This day last week*, *Today so far*, *This week so far*, and *This month so far*.
+ **Absolute time range** can be set in two ways: Typing exact time values or relative time values into the **From** and **To** fields and clicking **Apply time range**, or clicking a date or date range from the calendar displayed when you click the **From** or **To** field. To apply your selections, click **Apply time range**.

*Other time range features*

1. To zoom out, click **Cmd\$1Z** or **Ctrl\$1Z**. Click the icon to view a larger time range in the dashboard or panel visualization.

1. To use the zoom in feature, click and drag to select the time range in the visualization that you want to view.

**Note**  
Zooming in is only applicable to graph visualizations. 

*Refresh dashboards*

Click the **Refresh dashboard** icon to immediately run every query on the dashboard and refresh the visualizations. Grafana cancels any pending requests when you trigger a refresh.

By default, Grafana does not automatically refresh the dashboard. Queries run on their own schedule according to the panel settings. However, if you want to regularly refresh the dashboard, then click the down arrow next to the **Refresh dashboard** icon and then select a refresh interval.

**Control the time range using a URL**

You can control the time range of a dashboard by providing the following query parameters in the dashboard URL.
+ `from` defines the lower limit of the time range, specified in ms epoch, or [relative time](#v9-dash-setting-dashboard-time-range).
+ `to` defines the upper limit of the time range, specified in ms epoch, or relative time.
+ `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both parameters should be specified in ms. For example `?time=1500000000000&time.window=10000` results in 10s time range from 1499999995000 to 1500000005000.

# Building dashboards
<a name="v9-dash-building-dashboards"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

After you create a Grafana workspace and sign in, you can create dashboards and modify settings to suit your needs. 

**Topics**
+ [Creating dashboards](v9-dash-creating.md)
+ [Add or edit panels](v9-dash-edit-panels.md)
+ [Modifying dashboard settings](v9-dash-modify-settings.md)
+ [Dashboard URL variables](v9-dash-dashboard-url-variables.md)
+ [Adding a library panel to your dashboard](v9-dash-manage-library-panels.md)
+ [Managing dashboard version history](v9-dash-manage-version-history.md)
+ [Managing dashboard links](v9-dash-manage-dashboard-links.md)
+ [Dashboard JSON model](v9-dash-dashboard-json-model.md)

# Creating dashboards
<a name="v9-dash-creating"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

**Creating a dashboard **

Dashboards and panels allow you to show your data in visual form using Grafana. Each panel needs at least one query to display a visualization. Before you get started, complete the following prerequisites.
+ Ensure that you have the proper permissions. For more information about permissions, see [Users, teams, and permissions](Grafana-administration-authorization.md).
+ Identify the dashboard to which you want to add the panel.
+ Understand the query language of the target data source.
+ Ensure that data source for which you are writing a query has been added.

 To create a dashboard:

1. Sign into Grafana, hover your cursor over **Dashboard**, and click **\$1 New Dashboard**.

1. Click **Add a new panel**.

1. In the first line of the **Query** tab, click the dropdown list and select a data source.

1. Write or construct a query in the query language of your data source.

1. In the **Visualization** list, select a visualization type. Grafana displays a preview of your query results with the visualization applied. For more information, see [Visualizations options](v9-panels-viz.md).

1. Adjust panel settings in the following ways.
   + [Configure value mappings](v9-panels-configure-value-mappings.md)
   + [Visualization-specific options](v9-panels-viz.md)
   + [Override field values](v9-panels-configure-overrides.md)
   + [Configure thresholds](v9-panels-configure-thresholds.md)
   + [Configure standard options](v9-panels-configure-standard-options.md)
**Note**  
Most visualizations need some adjustment before they properly display the information you need.

1. Add a note to describe the visualization (or describe your changes) and then click **Save** in the upper-right corner of the page.
**Note**  
Notes are helpful if you need to revert the dashboard to a previous version.

**Configuring repeating rows**

You can configure Grafana to dynamically add panels or rows to a dashboard based on the value of a variable. Variables dynamically change your queries across all rows in a dashboard. For more information about repeating panels, see [Configure repeating panels]().

You can also repeat rows if you have variables set with `Multi-value` or `Include all values` selected.

Before you get started, ensure that the query includes a multi-value variable, then you should complete the following steps.

1. On the dashboard home page, click **Add panel**.

1. On the **Add a panel** dialog box, click **Add a new row**.

1. Hover over the row title and click the cog icon.

1. On the **Row Options** dialog box, add a title and select the variable for which you want to add repeating rows.
**Note**  
 To provide context to dashboard users, add the variable to the row title. 

**To move a panel**

1. Open the dashboard.

1. Click the panel title and drag the panel to the new location. You can place a panel on a dashboard in any location.

**To resize a panel**

1. Open the dashboard.

1. To adjust the size of the panel, click and drag the lower-right corner of the panel. You can size a dashboard panel to suits your needs.

# Add or edit panels
<a name="v9-dash-edit-panels"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

After you have created a dashboard, you can add, edit, or remove panels at any time.
+ **View dashboard**: To view a dashboard, from the **Home** menu, select **Dashboards**, then choose the dashboard you want to view. You might have to expand the folder that contains the dashboard.
+ **Add panel**: To add a panel to a dashboard, choose the **Add panel** icon in the menu bar near the top of the page.
+ **Edit panel**To edit an existing panel on a dashboard, choose the menu icon that appears when you hover over the panel, and then choose **Edit**.
+ **Remove panel**To remove an existing panel on a dashboard, choose the menu icon that appears when you hover over the panel, and then choose **Remove**.

# Modifying dashboard settings
<a name="v9-dash-modify-settings"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The dashboard settings page enables you to:
+ Edit general dashboard properties, including time settings.
+ Add annotation queries.
+ Add dashboard variables.
+ Add links.
+ View the dashboard JSON model

To access the dashboard setting page:

1. Open a dashboard in edit mode.

1. Click **Dashboard settings** (gear icon) located at the top of the page.

**Modifying dashboard time settings**

Adjust dashboard time settings when you want to change the dashboard timezone, the local browser time, and specify auto-refresh time intervals.

**To modify dashboard time settings**

1. On the **Dashboard** settings page, select **General**.

1. Navigate to the **Time Options** section.

1. Specify time settings according to the following descriptions.

1. Timezone specifies the local time zone of the service or system that you are monitoring. This can be helpful when monitoring a system or service that operates across several time zones.
   + Grafana uses the *default* selected time zone for the user profile, team, or organization. If no time zone is specified for the user profile, a team the user is a member of, or the organization, then Grafana uses the local browser time.
   + The time zone configured for the viewing user browser, the *local browser time*, is used. This is usually the same time zone as set on the computer.
   + Use standard [ISO 8601 time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), including UTC.
+ **Auto-refresh** customizes the options displayed for relative time and the auto-refresh options Entries are comma separated and accept any valid time unit.
+ **Now delay** overrides the `now` time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.
+ **Hide time picker** removes the Grafana time picker display.

**Note**  
To have time controls, your data must include a time column. See the documentation for your specific [data source](AMG-data-sources.md) for more information about including a time column.

**Adding an annotation query**

An annotation query is a query that queries for events. These events can be visualized in graphs across the dashboard as vertical lines along with a small icon you can hover over to see the event information.

**To add n annotation query**

1. On the **Dashboard settings** page, select **Annotations**.

1. Select **Add annotation query**. 

1. Enter a name and select a data source.

1. Complete the rest of the form to build a query and annotation.

The query editor UI changes based on the data source that you select. see the [Data source](AMG-data-sources.md) documentation for details on how to construct a query.

**Adding a variable**

Variables enable you to create more interactive and dynamic dashboards. Instead of hard-coding things like server, application, and sensor names in your metric queries, you can use variables in their place. Variables are displayed as dropdown lists at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.

For more information about variables, see [Variables](v9-dash-variables.md).

1. On the **Dashboard settings** page, click **Variable** in the left side section menu and then the **Add variable** button.

1. In the **General** section, the the name of the variable. This is the name that you will later use in queries.

1. Select a variable **Type**.
**Note**  
The variable type that you select impacts which fields that you populate on the page.

1. Define the variable and click **Update**.

**Adding a link **

Dashboard links enable you to place links to other dashboards and websites directly below the dashboard header. Links provide for easy navigation to other, related dashboards and content. 

1.  On the **Dashboard settings** page, click **Links** in the left side section menu and then the **Add link** button. 

1.  Enter title and and in the **Type** field, select **Dashboard** or **Link**. 

1.  To add a dashboard link, add an optional tag, select any of the dashboard link Options, and click **Apply**. 
**Note**  
Tags are useful creating a dynamic dropdown of dashboards that all have a specific tag. 

1.  To add a link, add a URL and tooltip text that appears when the user hovers over the link, select an icon that appears next to the link, and select any of the dashboard link options. 

**View dashboard JSON model ** 

A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from panels, template variables, panel queries, and so on. 

To view a dashboard JSON model, on the **Dashboard settings** page, click **JSON**.

For more information about the JSON fields, see [JSON fields](v9-dash-dashboard-json-model.md).

# Dashboard URL variables
<a name="v9-dash-dashboard-url-variables"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Grafana can apply variable values passed as query parameters in dashboard URLs. For more information, see [Manage dashboard links](v9-dash-manage-dashboard-links.md) and [Templates and variables](v9-dash-variables.md).

**Passing variables as query parameters**

Grafana interprets query string parameters prefixed with `var-` as variables in the given dashboard.

For example, in this URL: 

```
https://${your-domain}/path/to/your/dashboard?var-example=value
```

The query parameter `var-example=value` represents the dashboard variable example with a value of `value`.

**Passing multiple values for a variable**

To pass multiple values, repeat the variable parameter once for each value.

```
https://${your-domain}/path/to/your/dashboard?var-example=value1&var-example=value2
```

Grafana interprets `var-example=value1&var-example=value2` as the dashboard variable example with two values: `value1` and `value2`.

**Adding variables to dashboard links**

Grafana can add variables to dashboard links when you generate them from a dashboard’s settings. For more information and steps to add variables, see [Manage dashboard links](v9-dash-manage-dashboard-links.md).

**Passing ad hoc filters**

Ad hoc filters apply key or value filters to all metric queries that use a specified data source. For more information, see [Ad hoc filters]().

To pass an ad hoc filter as a query parameter, use the variable syntax to pass the ad hoc filter variable, and also provide the key, the operator as the value, and the value as a pipe-separated list.

For example, in this URL:

`https://${your-domain}/path/to/your/dashboard?var-adhoc=example_key|=|example_value` 

The query parameter `var-adhoc=key|=|value` applies the ad hoc filter configured as the adhoc dashboard variable using the `example_key` key, the `=` operator, and the `example_value` value.

**Note**  
When sharing URLs with ad hoc filters, remember to encode the URL. In the above example, replace the pipes `(|)` with `%7C` and the equality operator `(=)` with` %3D`.

**Controlling time range using the URL**

To set a dashboard’s time range, use the `from`, `to`, `time`, and `time.window` query parameters. Because these are not variables, they do not require the `var-` prefix.

# Adding a library panel to your dashboard
<a name="v9-dash-manage-library-panels"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A library panel is a reusable panel that you can use in any dashboard. When you change a library panel, the change propagates to all instances of where the panel is used. Library panels streamline reuse of panels across multiple dashboards.

You can save a library panel in a folder alongside saved dashboards.

**Creating a library panel**

When you create a library panel, the panel on the source dashboard is converted to a library panel as well. You need to save the original dashboard after a panel is converted.

1. Open a panel in edit mode.

1. In the panel display options, click the down arrow option to bring changes to the visualization.

1. To open the **Create** dialog box, click the **Library panels** option, and then click **Create library panel**.

1. In **Library panel name**, enter the name.

1. In **Save in folder**, select the folder to save the library panel.

1. To save your changes, click **Create library panel**.

1. To save the dashboard, click **Save**.

After a library panel is created, you can modify the panel using any dashboard on which it appears. After you save the changes, all instances of the library panel reflect these modifications.

**Adding a library panel to a dashboard**

Add a Grafana library panel to a dashboard when you want to provide visualizations to other dashboard users.

1. Hover over the **Dashboards** option on the left menu, then select **New dashboard** from the dropdown options. The **Add panel **dialog box will open.

1. Click the **Add a panel** from the panel library option. You will see a list of your library panels.

1. Filter the list or search to find the panel you want to add.

1. Click a panel to add it to the dashboard.

**Unlinking a library panel**

Unlink a library panel when you want to make a change to the panel and not affect other instances of the library panel.

1. Hover over **Dashboard** on the left menu, and then click **Library panels**.

1. Select a library panel that is being used in different dashboards.

1. Select the panel that you want to unlink.

1. Click the title of the panel and then click **Edit**. The panel will open in edit mode.

1. Click the **Unlink** option on the top right corner of the page.

**Viewing a list of library panels**

Unlink a library panel when you want to make a change to the panel and not affect other instances of the library panel.

1. Hover over the **Dashboard** option on the left menu, then click **Library panels**. You can see a list of previously defined library panels.

1. Search for a specific library panel if you know its name. You can also filter the panels by folder or type.

**Deleting a library panel**

Delete a library panel when you no longer need it.

1. Hover over **Dashboard** on the left menu, and select **Library panels**.

1. Select the panel that you want to delete.

1. Click the delete icon next to the library name.

# Managing dashboard version history
<a name="v9-dash-manage-version-history"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Whenever you save a version of your dashboard, a copy of that version is saved so that previous versions of your dashboard are never lost. A list of these versions is available by entering the dashboard settings and then selecting **Versions** in the left side menu.

The dashboard version history feature lets you compare and restore to previously saved dashboard versions.

**Comparing two dashboard versions**

To compare two dashboard versions, select the two versions from the list that you wish to compare. Click **Compare versions** to view the diff between the two versions.

Upon clicking the button, you’ll be brought to the diff view. By default, you’ll see a textual summary of the changes.

If you want to view the diff of the raw JSON that represents your dashboard, you can do that as well by clicking the **View JSON Diff** button at the bottom.

If you want to restore to the version you are diffing against, you can do so by clicking the **Restore to version <x>** button in the top right.

**Restoring to a previously saved dashboard version**

If you need to restore to a previously saved dashboard version, you can either click the **Restore** button on the right of a row in the dashboard version list, or click the **Restore to version <x>** button appearing in the diff view. Clicking the button will bring up the following pop-up prompting you to confirm the restoration.

After restoring to a previous version, a new version will be created containing the same exact data as the previous version, only with a different version number. This is indicated in the **Notes column** for the row in the new dashboard version. This is done simply to ensure your previous dashboard versions are not affected by the change.

# Managing dashboard links
<a name="v9-dash-manage-dashboard-links"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

You can use links to navigate between commonly used dashboards or to connect others to your visualizations. Links let you create shortcuts to other dashboards, panels, and even external websites.

Grafana supports dashboard links, panel links, and data links. Dashboard links are displayed at the top of the dashboard. Panel links are accessible by clicking an icon on the top left corner of the panel.

**Choosing which link to use**

Start by figuring out how you’re currently navigating between dashboards. If you’re often jumping between a set of dashboards and struggling to find the same context in each, links can help optimize your workflow.

The next step is to figure out which link type is right for your workflow. Even though all the link types in Grafana are used to create shortcuts to other dashboards or external websites, they work in different contexts.
+ If the link relates to most if not all of the panels in the dashboard, use dashboard links.
+ If you want to drill down into specific panels, use panel links.
+ If you want to link to an external site, you can use either a dashboard link or a panel link.
+ If you want to drill down into a specific series, or even a single measurement, use data links.

**Controlling time range using the URL**

To control the time range of a panel or dashboard, you can provide query parameters in the dashboard URL:
+ `from` defines lower limit of the time range, specified in ms epoch.
+ `to` defines upper limit of the time range, specified in ms epoch.
+ `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both params should be specified in ms. For example `?time=1500000000000&time.window=10000` will result in 10s time range from 1499999995000 to 1500000005000.

**Dashboard links**

When you create a dashboard link, you can include the time range and current template variables to directly jump to the same context in another dashboard. This way, you don’t have to worry whether the person you send the link to is looking at the right data. For other types of links, see [Data link variables]().

Dashboard links can also be used as shortcuts to external systems, such as submitting [a GitHub issue with the current dashboard name](https://github.com/grafana/grafana/issues/new?title=Dashboard%3A%20HTTP%20Requests).

After adding a dashboard link, it will show up in the upper-right corner of your dashboard.

**Adding links to dashboards**

Add links to other dashboards at the top of your current dashboard.

1. While viewing the dashboard you want to link, click the gear at the top of the screen to open **Dashboard settings**.

1. Click **Links** and then click **Add Dashboard Link** or **New**.

1. In **Type**, select **dashboards**.

1. Select link options from the following.
   + **With tags**: Enter tags to limit the linked dashboards to only the ones with the tags you enter. Otherwise, Grafana includes links to all other dashboards.
   + **As dropdown**: If you are linking to lots of dashboards, then you probably want to select this option and add an optional title to the dropdown. Otherwise, Grafana displays the dashboard links side by side across the top of your dashboard.
   + **Time range**: Select this option to include the dashboard time range in the link. When the user clicks the link, the linked dashboard will open with the indicated time range already set.
   + **Variable values**: Select this option to include template variables currently used as query parameters in the link. When the user clicks the link, any matching templates in the linked dashboard are set to the values from the link. For more information, see [Dashboard URL variables](v9-dash-dashboard-url-variables.md).
   + **Open in new tab**: Select this option if you want the dashboard link to open in a new tab or window.

1. Click **Add**.

**Adding a URL link to a dashboard**

Add a link to a URL at the top of your current dashboard. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana.

1. While viewing the dashboard you want to link, click the gear at the top of the screen to open **Dashboard settings**.

1. Click **Links** and then click **Add Dashboard Link** or **New**.

1. In Type, select **Link**.

1. Select link options from the following.
   + **URL**: Enter the URL you want to link to. Depending on the target, you might want to include field values. For more information, see this [Github example](https://github.com/grafana/grafana/issues/new?title=Dashboard%3A%20HTTP%20Requests).
   + **Title**: Enter the title you want the link to display.
   + **Tooltip**: Enter the tooltip you want the link to display.
   + **Icon**: Choose the icon that you want displayed with the link.
   + **Time range**: Select this option to include the dashboard time range in the link. When the user clicks the link, the linked dashboard will open with the indicated time range set.
     + `from` defines lower limit of the time range, specified in ms epoch.
     + `to` defines upper limit of the time range, specified in ms epoch.
     + `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both params should be specified in ms. For example `?time=1500000000000&time.window=10000` will result in 10s time range from 1499999995000 to 1500000005000.
   + **Variable values**: Select this option to include template variables currently used as query parameters in the link. When the user clicks the link, any matching templates in the linked dashboard are set to the values from the link. 

     The variable format is as follows: 

     `https://${you-domain}/path/to/your/dashboard?var-${template-varable1}=value1&var-{template-variable2}=value2`
   + **Open in a new tab**: Select this option if you want the dashboard link to open in a new tab or window

1. Click **Add**.

**Updating a dashboard link**

To change or update an existing dashboard link, follow this procedure.

1. In **Dashboard settings,** on the **Links** tab, click the existing link that you want to edit.

1. Change the settings and then click **Update**.

**Duplicating a dashboard link**

To duplicate an existing dashboard link, click the duplicate icon next to the existing link that you want to duplicate.

**Deleting a dashboard link**

To delete an existing dashboard link, click the trash icon next to the duplicate icon that you want to delete.

**Panel links**

Each panel can have its own set of links that are shown in the upper left corner of the panel. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana.

To see available panel links, click the icon on the top left corner of a panel.
+ **Adding a panel link**: Each panel can have its own set of links that are shown in the upper left corner of the panel. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana. Click the icon on the top left corner of a panel to see available panel links.

  1. Hover your cursor over the panel that you want to add a link to and then press `e`. Or click the dropdown arrow next to the panel title and then click **Edit**.

  1. On the **Panel** tab, scroll down to the **Links** section. 

  1. Expand **Links** and then click **Add link**.

  1. Enter a **Title**. **Title** is a human-readable label for the link that will be displayed in the UI.

  1. Enter the **URL** you want to link to. You can even add one of the template variables defined in the dashboard. Press `Ctrl+Space` or `Cmd+Space` and click in the URL field to see the available variables. By adding template variables to your panel link, the link sends the user to the right context, with the relevant variables already set.

     You can also use time variables.
     + `from` defines the lower limit of the time range, specified in ms epoch.
     + `to` defines the upper limit of the time range, specified in ms epoch.
     + `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both parameters should be specified in ms. For example `?time=1500000000000&time.window=10000` results in 10s time range from 1499999995000 to 1500000005000.
+ **Updating a panel link**

  1. On the **Panel** tab, find the link you want to make changes to.

  1. Click the **Edit** (pencil) icon to open the Edit link window.

  1. Make any necessary changes.

  1. Click **Save** to save changes and close the window.

  1. Click **Save** in the upper right to save your changes to the dashboard.
+ **Deleting a panel link**

  1. On the **Panel** tab, find the link that you want to make changes to.

  1. Click the **X** icon next to the link you want to delete.

  1. Click **Save** in the upper right to save your changes to the dashboard.

# Dashboard JSON model
<a name="v9-dash-dashboard-json-model"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from panels, template variables, and panel queries.

To view the JSON of a dashboard.

1. Navigate to a dashboard.

1. In the top navigation menu, click the **Dashboard settings** (gear) icon.

1. Click **JSON Model**.

**JSON fields**

When a user creates a new dashboard, a new dashboard JSON object is initialized with the following fields.

**Note**  
In the following JSON, id is shown as null, which is the default value assigned to it until a dashboard is saved. After a dashboard is saved, an integer value is assigned to the `id` field.

```
{
  "id": null,
  "uid": "cLV5GDCkz",
  "title": "New dashboard",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "graphTooltip": 1,
  "panels": [],
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "time_options": [],
    "refresh_intervals": []
  },
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "refresh": "5s",
  "schemaVersion": 17,
  "version": 0,
  "links": []
}
```

The following describes each field in the dashboard JSON.


| Name | Usage | 
| --- | --- | 
| **id** | unique numeric identifier for the dashboard (generated by the db) | 
| **uid** | unique dashboard identifier that can be generated by anyone. string (8-40) | 
| **title** | current title of dashboard | 
| **tags** | tags associated with dashboard, an array of strings | 
| **style** | theme of dashboard, such as *dark* or *light* | 
| **timezone** | timezone of dashboard, such as *utc* or *browser* | 
| **editable** | if a dashboard is editable or not | 
| **graphTooltip** | 0 for no shared crosshair or tooltip (default), 1 for shared crosshair, 2 for shared crosshair and shared tooltip | 
| **time** | time range for dashboard, such as *last 6 hours* or *last 7 days* | 
| **timepicker** | timepicker metadata, see [timepicker section](#v9-dash-dashboard-json-model) for details | 
| **templating** | templating metadata, see [templating section](#v9-dash-dashboard-json-model) for details | 
| **annotations** | annotations metadata, see [annotations](v9-panels-annotate-visualizations.md) for how to add them | 
| **refresh** | auto-refresh interval | 
| **schemaVersion** | version of the JSON schema (integer), incremented each time a Grafana update brings changes to said schema | 
| **version** | version of the dashboard (integer), incremented each time the dashboard is updated | 
| **panels** | panels array (see below for detail) | 

**Panels**

Panels are the building blocks of a dashboard. It consists of data source queries, type of graphs, aliases, and more. Panel JSON consists of an array of JSON objects, each representing a different panel. Most of the fields are common for all panels but some fields depend on the panel type. The following is an example of panel JSON of a text panel.

```
"panels": [
  {
    "type": "text",
    "title": "Panel Title",
    "gridPos": {
      "x": 0,
      "y": 0,
      "w": 12,
      "h": 9
    },
    "id": 4,
    "mode": "markdown",
    "content": "# title"
  }
```

**Panel size and position**

The gridPos property describes the panel size and position in grid coordinates.
+ `w`: 1–24 (the width of the dashboard is divided into 24 columns)
+ `h`: In grid height units, each represents 30 pixels.
+ `x`: The x position, in same unit as `w`.
+ `y`: The y position, in same unit as `h`.

The grid has a negative gravity that moves up panels if there is empty space above a panel.

**Timepicker**

```
"timepicker": {
    "collapse": false,
    "enable": true,
    "notice": false,
    "now": true,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "status": "Stable",
    "type": "timepicker"
  }
```

**Templating **

The `templating` field contains an array of template variables with their saved values along with some other metadata.

```
"templating": {
    "enable": true,
    "list": [
       {
        "allFormat": "wildcard",
        "current":  {
          "tags": [],
          "text": "prod",
          "value": "prod"
        },
        "datasource": null,
        "includeAll": true,
        "name": "env",
        "options": [
           {
            "selected": false,
            "text": "All",
            "value": "*"
          },
           {
            "selected": false,
            "text": "stage",
            "value": "stage"
          },
           {
            "selected": false,
            "text": "test",
            "value": "test"
          }
        ],
        "query": "tag_values(cpu.utilization.average,env)",
        "refresh": false,
        "type": "query"
      },
       {
        "allFormat": "wildcard",
        "current":  {
          "text": "apache",
          "value": "apache"
        },
        "datasource": null,
        "includeAll": false,
        "multi": false,
        "multiFormat": "glob",
        "name": "app",
        "options": [
           {
            "selected": true,
            "text": "tomcat",
            "value": "tomcat"
          },
           {
            "selected": false,
            "text": "cassandra",
            "value": "cassandra"
          }
        ],
        "query": "tag_values(cpu.utilization.average,app)",
        "refresh": false,
        "regex": "",
        "type": "query"
      }
    ]
  }
```

# Managing dashboards
<a name="v9-dash-managing-dashboards"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A dashboard is a set of one or more [panels](v9-panels.md) that visually presents your data in one or more rows.

For more information about creating dashboards, see [Add and organize panels]().

## Creating dashboard folders
<a name="v9-dash-create-dashboard-folder"></a>

Folders help you organize and group dashboards, which is useful when you have many dashboards or multiple teams using the same Grafana instance.

**Prerequisites**

Ensure that you have Grafana Admin permissions. For more information about dashboard permissions, see [Dashboard permissions](Grafana-administration-authorization.md).

**To create a dashboard folder**

1. Sign in to Grafana and on the side menu, click **Dashboards > New folder**

1. Enter a unique name and click **Create**.

**Note**  
When you save a dashboard, you can either select a folder for the dashboard to be saved in or create a new folder.

## Managing dashboards and folders
<a name="v9-dash-manage-dashboard-folder"></a>

On the **Manage dashboards and folders** page, you can:
+ Create a folder
+ Create a dashboard
+ Move dashboards into folders
+ Delete multiple dashboards
+ Navigate to a folder page where you can assign folder and dashboard permissions

**Dashboard folder page**

You can complete the following tasks on the **Dashboard Folder** page:
+ Move or delete dashboards in a folder.
+ Rename a folder (available under the **Settings** tab).
+ Assign permissions to folders (which are inherited by the dashboards in the folder).

To navigate to the dashboard folder page, click the cog appears when you hover over a folder in the dashboard search result list or the **Manage dashboards and folders** page.

**Dashboard permissions**

You can assign permissions to a folder. Any permissions you assign are inherited by the dashboards in the folder. An Access Control List (ACL) is used where **Organization Role**, **Team**, and a **User **can be assigned permissions.

See [permissions](Grafana-permissions.md) for more information.

## Exporting and importing dashboards
<a name="v9-dash-export-import-dashboards"></a>

You can use the Grafana UI or the HTTP API to export and import dashboards.

**Exporting a dashboard**

The dashboard export action creates a Grafana JSON file that contains everything you need, including layout, variables, styles, data sources, queries, and so on, so that you can later import the dashboard.

**Note**  
Grafana downloads a JSON file to your local machine. 

1. Open the dashboard that you want to export.

1. Select the share icon.

1. Choose **Export**.

1. Choose **Save to file.**

**Making a dashboard portable**

If you want to export a dashboard for others to use, you can add template variables for things like a metric prefix (use a constant variable) and server name.

A template variable of the type `Constant` will automatically be hidden in the dashboard, and will also be added as a required input when the dashboard is imported.

**Importing a dashboard**

1. Choose **Dashboards** in the side menu.

1. Choose **New**, then select **Import** from the dropdown menu.

1. Perform one of the following steps.
   + Upload a dashboard JSON file.
   + Paste a [Grafana.com](https://grafana.com/) dashboard URL.
   + Paste dashboard JSON text directly into the text area.

   The import process enables you to change the name of the dashboard, pick the data source you want the dashboard to use, and specify any metric prefixes (if the dashboard uses any).

## Troubleshooting dashboards
<a name="v9-dash-troubleshooting"></a>

This section provides information to help you solve common dashboard problems. 

**Dashboard is slow**

If your dashboard is slow, consider the following:
+ Are you trying to render dozens (or hundreds or thousands) of time-series on a graph? This can cause the browser to lag. Try using functions like highestMax (in Graphite) to reduce the returned series.
+ Sometimes the series names can be very large. This causes larger response sizes. Try using alias to reduce the size of the returned series names.
+ Are you querying many time-series or for a long range of time? Both of these conditions can cause Grafana or your data source to pull in a lot of data, which can slow it down.
+ It could be high load on your network infrastructure. If the slowness isn’t consistent, this might be the problem.

**Dashboard refresh rate issues**

By default, Grafana queries your data source every 30 seconds. Setting a low refresh rate on your dashboards puts unnecessary stress on the backend. In many cases, querying this frequently isn’t necessary because the data isn’t being sent to the system such that changes would be seen.

If you have this issue, the following solutions are recommended.
+ Do not enable auto-refreshing on dashboards, panels, or variables unless you need it. Users can refresh their browser manually, or you can set the refresh rate for a time period that makes sense (such as very ten minutes or every hour).
+ If it is required, then set the refresh rate to once a minute. Users can always refresh the dashboard manually.
+ If your dashboard has a longer time period (such as one week), then automated refreshing might not be necessary.

**Handling or rendering null data is wrong or confusing**

Some applications publish data intermittently. For example, they only post a metric when an event occurs. By default, Grafana graphs connect lines between the data points.

# Sharing dashboards and panels
<a name="v9-dash-sharing"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Grafana enables you to share dashboards and panels with other users within an organization and in certain situations, publicly on the Web. You can share using:
+ A direct link
+ A snapshot
+ An export link (for dashboards only)

You must have an authorized viewer permission to see an image rendered by a direct link.

The same permission is also required to view embedded links unless you have anonymous access permission enabled for your Grafana instance.

When you share a panel or dashboard as a snapshot, a snapshot (which is a panel or dashboard at the moment you take the snapshot) is publicly available on the web. Anyone with a link to it can access it. Because snapshots do not require any authorization to view, Grafana removes information related to the account it came from, as well as any sensitive data from the snapshot.

## Sharing a dashboard
<a name="v9-dash-share-dashboard"></a>

You can share a dashboard as a direct link or as a snapshot. You can also export a dashboard.

**Note**  
If you change a dashboard, ensure that you save the changes before sharing.

1. Navigate to the home page of your Grafana instance.

1. Click on the share icon in the top navigation.

   The share dialog box will open and show the **Link** tab.

**Sharing a direct link**

The **Link** tab shows the current time range, template variables, and the default theme. You can also share a shortened URL.

1. Click **Copy**. This action copies the default or the shortened URL to the clipboard.

1. Send the copied URL to a Grafana user with authorization to view the link.

**Publishing a snapshot**

A dashboard snapshot shares an interactive dashboard publicly. Grafana strips sensitive data such as queries (metric, template, and annotation) and panel links, leaving only the visible metric data and series names embedded in the dashboard. Dashboard snapshots can be accessed by anyone with the link.

You can publish snapshots to your local instance.

1. Click **Local Snapshot**.

1. Grafana generates a link of the snapshot. Copy the snapshot link, and share it either within your organization or publicly on the web.

**Exporting a dashboard**

Grafana dashboards can easily be exported and imported. For more information, see [Export and import dashboards](v9-dash-managing-dashboards.md#v9-dash-export-import-dashboards).

## Sharing a panel
<a name="v9-dash-share-panel"></a>

You can share a panel as a direct link, or as a snapshot. You can also create library panels using the **Share** option on any panel.

1. Click a panel title to open the panel menu.

1. Click **Share**. The share dialog box will open and show the **Link** tab.

**Using a direct link**

The **Link** tab shows the current time range, template variables, and the default theme. You can optionally enable a shortened URL to share. 

1. Click **Copy** to copy the default or the shortened URL to the clipboard. 

1. Send the copied URL to a Grafana user with authorization to view the link.

1. You also optionally click **Direct link rendered image** to share an image of the panel.

**Querying string parameters for server-side rendered images**
+ **width**: Width in pixels. The default is 800.
+ **height**: Height in pixels. The default is 400.
+ **tz**: Timezone in the format `UTC%2BHH%3AMM` where HH and MM are offset in hours and minutes after UTC.
+ **timeout**: Number of seconds. The timeout can be increased if the query for the panel needs more than the default 30 seconds.
+ **scale**: Numeric value to configure device scale factor. Default is 1. Use a higher value to produce more detailed images (higher DPI). Supported in Grafana v7.0\$1.

**Publishing a snapshot**

A panel snapshot shares an interactive panel publicly. Grafana strips sensitive data leaving only the visible metric data and series names embedded in the dashboard. Panel snapshots can be accessed by anyone with the link

You can publish snapshots to your local instance.

1. In the **Share Panel** dialog box, click **Snapshot** to open the tab.

1. Click **Local Snapshot**. Grafana generates the link of the snapshot.

1. Copy the snapshot link, and share it either within your organization or publicly on the web.

If you created a snapshot by mistake, click **Delete snapshot** to remove the snapshot from your Grafana instance.

**Creating a library panel**

To create a library panel from the **Share Panel **dialog box.

1. Click **Library panel**.

1. In **Library panel name**, enter the name.

1. In **Save in folder**, select the folder in which to save the library panel. By default, the **General** folder is selected.

1. Click **Create library** panel to save your changes.

1. Click **Save** to save the dashboard.

# Managing playlists
<a name="v9-dash-managing-playlists"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A *playlist* is a list of dashboards that are displayed in a sequence. You might use a playlist to build situational awareness or to present your metrics to your team or visitors. Grafana automatically scales dashboards to any resolution, which makes them perfect for large screens. You can access the playlist feature from Grafana’s side menu in the **Dashboards** submenu.

## Accessing, sharing, and controlling a playlist
<a name="v9-dash-access-share-control-playlist"></a>

Use the information in this section to access existing playlists. Start and control the display of a playlist using one of the five available modes.

**Accessing a playlist**

1. Hover your cursor over Grafana’s side menu.

1. Click **Playlists**.

   You will see a list of existing playlists.

**Starting a playlist**

You can start a playlist in five different view modes. View mode determines how the menus and navigation bar appear on the dashboards.

By default, each dashboard is displayed for the amount of time entered in the **Interval** field, which you set when you create or edit a playlist. After you start a playlist, you can control it with the navigation bar at the top of the page.

The playlist displays each dashboard for the time specified in the `Interval` field, set when creating or editing a playlist. After a playlist starts, you can control it using the navigation bar at the top of your screen.

1. Access the playlist page to see a list of existing playlist.

1. Find the playlist that you want to start, then click **Start playlist**.

   The start playlist dialog box will open.

1. Select one of the five playlist modes available based on the information in the following table.

1. Click Start.


| Mode | Description | 
| --- | --- | 
| Normal mode |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-managing-playlists.html)  | 
| TV mode |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-managing-playlists.html)  | 
| TV mode (with auto fit panels) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-managing-playlists.html)  | 
| Kiosk mode |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-managing-playlists.html)  | 
| Kiosk mode (with auto fit panels) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v9-dash-managing-playlists.html)  | 

**Controlling a playlist**

You can control a playlist in **Normal** or **TV** mode after it has started, using the navigation bar at the top of your screen. Press the `Esc` key in your keyboard to stop the playlist.


| Button | Action | 
| --- | --- | 
| Next (double-right arrow) | Advances to the next dashboard. | 
| Back (left arrow) | Returns to the previous dashboard. | 
| Stop (square) | Ends the playlist, and exits to the current dashboard. | 
| Cycle view mode (monitor icon) | Rotates the display of the dashboards in different view modes. | 
| Time range | Displays data within a time range. It can be set to display the last 5 minutes up to 5 years ago, or a custom time range, using the down arrow. | 
| Refresh (circle arrow) | Reloads the dashboard, to display the current data. It can be set to reload automatically every 5 seconds to 1 day, using the dropdown arrow. | 

## Creating a playlist
<a name="v9-dash-create-playlist"></a>

You can create a playlist to present dashboards in a sequence with a set order and time interval between dashboards.

1. Click **New playlist** on the playlist page.

1. Enter a descriptive name in the **Name** text box.

1. Enter a time interval in the **Interval** text box.
**Note**  
The dashboards you add are listed in a sequential order.

1. In** Dashboards**, add existing dashboards to the playlist using the **Add by title** and **Add by tag** dropdown options.

1. Optionally:
   + Search for a dashboard by its name, a regular expression, or a tag.
   + Filter your results by starred status or tags.
   + Rearrange the order of the dashboard you have added using the up and down arrow icon.
   + Remove a dashboard from the playlist by clicking the **X **icon beside dashboard.

1. Click **Save** to save your changes.

## Saving a playlist
<a name="v9-dash-save-playlist"></a>

You can save a playlist and add it to your **Playlists** page, where you can start it.

**Important**  
Ensure all the dashboards that you want to appear in your playlist are added when creating or editing the playlist before saving it.

1. To access the playlist feature, hover your cursor over Grafana’s side menu.

1. Click **Playlists** to view the playlists available to you.

1. Click on the playlist of your choice.

1. Edit the playlist.

1. Check that the playlist has a **Name**, **Interval**, and at least one **Dashboard** added to it.

1. Click **Save** to save your changes.

## Editing or deleting a playlist
<a name="v9-dash-edit-delete-playlist"></a>

You can edit a playlist by updating its name, interval time, and by adding, removing, and rearranging the order of dashboards.

**Editing a playlist**

1. Click **Edit playlist** on the playlist page.

1. Update the name and time interval, then add or remove dashboards from the playlist using instructions in Create a playlist, above.

1. Click **Save** to save your changes.

**Deleting a playlist**

1. Click **Playlists**.

1. Click **Remove** next to the playlist you want to delete.

**Rearranging dashboard order**

1. Next to the dashboard you want to move, click the up or down arrow.

1. Click **Save** to save your changes.

**Removing a dashboard**

1. Click **Remove **to remove a dashboard from the playlist.

1. Click **Save** to save your changes.

## Sharing a playlist in view mode
<a name="v9-dash-share-playlist-view-mode"></a>

You can share a playlist by copying the link address on the view mode you prefer, and pasting the URL to your destination.

1. From the **Dashboards** submenu, click **Playlists**.

1. Click **Start playlist** next to the playlist you want to share.

1. In the dropdown, right click the view mode you prefer.

1. Click **Copy Link Address** to copy the URL to your clipboard.

1. Paste the URL to your destination.

# Adding and managing dashboard variables
<a name="v9-dash-variables"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles. So when you change the value, using the dropdown at the top of the dashboard, your panel’s metric queries will change to reflect the new value.

Variables allow you to create more interactive and dynamic dashboards. Instead of hard-coding things like server, application, and sensor names in your metric queries, you can use variables in their place. Variables are displayed as dropdown lists at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.

These can be especially useful for administrators who want to allow Grafana viewers to quickly adjust visualizations but do not want to give them full editing permissions. Grafana Viewers can use variables.

Variables and templates also allow you to single-source dashboards. If you have multiple identical data sources or servers, you can make one dashboard and use variables to change what you are viewing. This simplifies maintenance and upkeep enormously.

**Templates**

A template is any query that contains a variable. For example, if you were administering a dashboard to monitor several servers, you could make a dashboard for each server, or you could create one dashboard and use panels with template queries, such as the following.

```
wmi_system_threads{instance=~"$server"}
```

Variable values are always synced to the URL using the syntax var-<varname>=value.

**Examples**

Variables are listed in dropdown lists across the top of the screen. Select different variables to see how the visualizations change.

To see variable settings, navigate to **Dashboard Settings > Variables**. Click a variable in the list to see its settings. 

Variables can be used in titles, descriptions, text panels, and queries. Queries with text that starts with `$` are templates. Not all panels will have template queries.

**Variable best practices**
+ Variable dropdown lists are displayed in the order they are listed in the variable list in **Dashboard settings**.
+ Put the variables that you will change often at the top, so they will be shown first (far left on the dashboard).

# Add and manage variables
<a name="v9-dash-variable-add"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The following table lists the types of variables shipped with Grafana.


| Variable type | Description | 
| --- | --- | 
|  Query  |  Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. Add a query variable.  | 
|  Custom  |  Define the variable options manually using a comma-separated list. Add a custom variable.  | 
|  Text box  |  Display a free text input field with an optional default value. Add a text box variable.  | 
|  Constant  |  Define a hidden constant. Add a constant variable.  | 
|  Data source  |  Quickly change the data source for an entire dashboard. Add a data source variable.  | 
|  Interval  |  Interval variables represent time spans. Add an interval variable.  | 
|  Ad hoc filters  |  Key-value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only). Add ad hoc filters.  | 
|  Global variables  |  Built-in variables that can be used in expressions in the query editor. Refer to Global variables.  | 
|  Chained variables  |  Variable queries can contain other variables. Refer to Chained variables.  | 

## Entering General options
<a name="v9-dash-variable-options"></a>

You must enter general options for any type of variable that you create.

**To enter general options**

1. Navigate to the dashboard you want to make a variable for and select the **Dashboard settings** (gear) icon at the top of the page.

1. On the **Variables** tab, select **New**.

1. Enter a **Name** for the variable.

1. In the **Type** list, select **Query**.

1. (Optional) In **Label**, enter the display name of the variable dropdown.

   If you don’t enter a display name, then the dropdown label is the variable name.

1. Choose a **Hide** option:
   + **No selection (blank):** The variable dropdown displays the variable **Name** or **Label** value.
   + **Label:** The variable dropdown only displays the selected variable value and a down arrow.
   + **Variable:** No variable dropdown is displayed on the dashboard.

## Adding a query variable
<a name="v9-dash-variable-add-query"></a>

Query variables enable you to write a data source query that can return a list of metric names, tag values, or keys. For example, a query variable might return a list of server names, sensor IDs, or data centers. The variable values change as they dynamically fetch options with a data source query.

Query variables are generally only supported for strings. If your query returns numbers or any other data type, you might need to convert them to strings in order to use them as variables. For the Azure data source, for example, you can use the [tostring](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/tostringfunction) function for this purpose.

Query expressions can contain references to other variables and in effect create linked variables. Grafana detects this and automatically refreshes a variable when one of its linked variables change.

**Note**  
Query expressions are different for each data source. For more information, refer to the documentation for your [data source](AMG-data-sources.md).

**To add a query variable**

1. Enter general options, as above.

1. In the **Data source** list, select the target data source for the query.

1. In the **Refresh** list, select when the variable should update options.
   + **On Dashboard Load:** Queries the data source every time the dashboard loads. This slows down dashboard loading, because the variable query needs to be completed before dashboard can be initialized.
   + **On Time Range Change:** Queries the data source when the dashboard time range changes. Only use this option if your variable options query contains a time range filter or is dependent on the dashboard time range.

1. In the **Query** field, enter a query.
   + The query field varies according to your data source. Some data sources have custom query editors.
   + If you need more room in a single input field query editor, then hover your cursor over the lines in the lower right corner of the field and drag downward to expand.

1. (Optional) In the **Regex** field, type a regex expression to filter or capture specific parts of the names returned by your data source query. To see examples, refer to [Filter variables with regex](#v9-dash-variable-add-filter).

1. In the **Sort** list, select the sort order for values to be displayed in the dropdown list. The default option, **Disabled**, means that the order of options returned by your data source query will be used.

1. (Optional) Enter [Selection Options](#v9-dash-variable-add-selection).

1. In **Preview of values**, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.

1. Select **Add** to add the variable to the dashboard.

## Adding a custom variable
<a name="v9-dash-variable-add-custom"></a>

Use a *custom* variable for a value that does not change, such as a number or a string.

For example, if you have server names or Region names that never change, then you might want to create them as custom variables rather than query variables. Because they do not change, you might use them in [chained variables](#v9-dash-variable-add-chained) rather than other query variables. That would reduce the number of queries Grafana must send when chained variables are updated.

**To add a custom variable**

1. Enter general options, as above.

1. In the 

   **Values separated by comma** list, enter the values for this variable in a comma-separated list. You can include numbers, strings, or key-value pairs separated by a space and a colon. For example, `key1 : value1,key2 : value2`.

1. (Optional) Enter [Selection Options](#v9-dash-variable-add-selection).

1. In **Preview of values**, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.

1. Select **Add** to add the variable to the dashboard.

## Adding a text box variable
<a name="v9-dash-variable-add-text"></a>

*Text box* variables display a free text input field with an optional default value. This is the most flexible variable, because you can enter any value. Use this type of variable if you have metrics with high cardinality or if you want to update multiple panels in a dashboard at the same time.

**To add a text box variable**

1. Enter general options, as above.

1. (Optional) In the **Default value** field, select the default value for the variable. If you do not enter anything in this field, then Grafana displays an empty text box for users to type text into.

1. In **Preview of values**, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.

1. Select **Add** to add the variable to the dashboard.

## Adding a constant variable
<a name="v9-dash-variable-add-constant"></a>

*Constant* variables enable you to define a hidden constant. This is useful for metric path prefixes for dashboards you want to share. When you export a dashboard, constant variables are converted to import options.

Constant variables are *not* flexible. Each constant variable only holds one value, and it cannot be updated unless you update the variable settings.

Constant variables are useful when you have complex values that you need to include in queries but don’t want to retype in every query. For example, if you had a server path called `i-0b6a61efe2ab843gg`, then you could replace it with a variable called `$path_gg`.

**To add a constant variable**

1. Enter general options, as above.

1. In the **Value** field, enter the variable value. You can enter letters, numbers, and symbols. You can even use wildcards if you use [raw format](https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#raw).

1. In **Preview of values**, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.

1. Select **Add** to add the variable to the dashboard.

## Adding a data source variable
<a name="v9-dash-variable-add-datasource"></a>

*Data source* variables enable you to quickly change the data source for an entire dashboard. They are useful if you have multiple instances of a data source, perhaps in different environments.

**To add a data source variable**

1. Enter general options, as above.

1. In the **Type** list, select the target data source for the variable.

1. (Optional) In **Instance name filter**, enter a regex filter for which data source instances to choose from in the variable value dropdown list. Leave this field empty to display all instances.

1. (Optional) Enter [Selection Options](#v9-dash-variable-add-selection).

1. In **Preview of values**, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.

1. Select **Add** to add the variable to the dashboard.

## Adding an interval variable
<a name="v9-dash-variable-add-internal"></a>

Use an *interval* variable to represents time spans such as `1m`,`1h`, or `1d`. You can think of them as a dashboard-wide *group by time* command. Interval variables change how the data is grouped in the visualization. You can also use the Auto Option to return a set number of data points per time span.

You can use an interval variable as a parameter to group by time (for InfluxDB), date histogram interval (for Elasticsearch), or as a summarize function parameter (for Graphite).

**To add an interval variable**

1. Enter general options, as above.

1. In the **Values** field, enter the time range intervals that you want to appear in the variable dropdown list. The following time units are supported: `s (seconds)`, `m (minutes)`, `h (hours)`, `d (days)`, `w (weeks)`, `M (months)`, and `y (years)`. You can also accept or edit the default values: `1m,10m,30m,1h,6h,12h,1d,7d,14d,30d`.

1. (Optional) Turn on the **Auto Option** if you want to add the `auto` option to the list. This option allows you to specify how many times the current time range should be divided to calculate the current `auto` time span. If you turn it on, then two more options appear:
   + **Step count -** Select the number of times the current time range will be divided to calculate the value, similar to the **Max data points** query option. For example, if the current visible time range is 30 minutes, then the `auto` interval groups the data into 30 one-minute increments. The default value is 30 steps.
   + **Min Interval -** The minimum threshold below which the step count intervals will not divide the time. To continue the 30 minute example, if the minimum interval is set to 2m, then Grafana would group the data into 15 two-minute increments.

1. In **Preview of values**, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.

1. Select **Add** to add the variable to the dashboard.

**Interval variable examples**

The following example shows a template variable `myinterval` in a Graphite function:

```
summarize($myinterval, sum, false)
```

## Adding ad hoc filters
<a name="v9-dash-variable-add-adhoc"></a>

*Ad hoc filters* enable you to add key-value filters that are automatically added to all metric queries that use the specified data source. Unlike other variables, you do not use ad hoc filters in queries. Instead, you use ad hoc filters to write filters for existing queries.

**Note**  
Ad hoc filter variables only work with Prometheus, Loki, InfluxDB, and Elasticsearch data sources.

1. Enter general options, as above.

1. In the **Data source** list, select the target data source.

1. Select **Add** to add the variable to the dashboard.

**Create ad hoc filters**

Ad hoc filters are one of the most complex and flexible variable options available. Instead of a regular list of variable options, this variable allows you to build a dashboard-wide ad hoc query. Filters you apply in this manner are applied to all panels on the dashboard.

## Configure variable selection options
<a name="v9-dash-variable-add-selection"></a>

**Selection Options** are a feature you can use to manage variable option selections. All selection options are optional, and they are off by default.

### Multi-value variables
<a name="v9-dash-variable-add-selection-multi"></a>

Interpolating a variable with multiple values selected is tricky as it is not straight forward how to format the multiple values into a string that is valid in the given context where the variable is used. Grafana tries to solve this by allowing each data source plugin to inform the templating interpolation engine what format to use for multiple values.

**Note**  
The **Custom all value** option on the variable must be blank for Grafana to format all values into a single string. If it is left blank, then Grafana concatenates (adds together) all the values in the query. For example, `value1,value2,value3`. If a custom `all` value is used, then instead the value will be `*` or `all`.

**Multi-value variables with a Graphite data source**

Graphite uses glob expressions. A variable with multiple values would, in this case, be interpolated as `{host1,host2,host3}` if the current variable value was *host1*, *host2*, and *host3*.

**Multi-value variables with a Prometheus or InfluxDB datasource**

InfluxDB and Prometheus use regex expressions, so the same variable would be interpolated as `(host1|host2|host3)`. Every value would also be regex escaped. If not, a value with a regex control character would break the regex expression.

**Multi-value variables with an Elastic data source**

Elasticsearch uses lucene query syntax, so the same variable would be formatted as `("host1" OR "host2" OR "host3")`. In this case, every value must be escaped so that the value only contains lucene control words and quotation marks.

**Troubleshoot multi-value variables**

Automatic escaping and formatting can cause problems and it can be tricky to grasp the logic behind it. Especially for InfluxDB and Prometheus where the use of regex syntax requires that the variable is used in regex operator context.

If you do not want Grafana to do this automatic regex escaping and formatting, then you must do one of the following:
+ Turn off the **Multi-value** or **Include All option** options.
+ Use the [raw variable format](https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#raw).

### Include All option
<a name="v9-dash-variable-add-multi-all"></a>

Grafana adds an `All` option to the variable dropdown list. If a user selects this option, then all variable options are selected.

### Custom all value
<a name="v9-dash-variable-add-multi-custom"></a>

This option is only visible if the **Include All option** is selected.

Enter regex, globs, or lucene syntax in the **Custom all value** field to define the value of the `All` option.

By default the `All` value includes all options in a combined expression. This can become very long and can have performance problems. Sometimes it can be better to specify a custom all value, like a wildcard regex.

To have custom regex, globs, or lucene syntax in the **Custom all value** option, it is never escaped so you will have to think about what is a valid value for your data source.

## Global variables
<a name="v9-dash-variable-add-global"></a>

Grafana has global built-in variables that can be used in expressions in the query editor. This topic lists them in alphabetical order and defines them. These variables are useful in queries, dashboard links, panel links, and data links.

**\$1\$1\$1dashboard**

This variable is the name of the current dashboard.

**\$1\$1\$1from and \$1\$1\$1to**

Grafana has two built-in time range variables: `$__from` and `$__to`. They are currently always interpolated as epoch milliseconds by default, but you can control date formatting.


| Syntax | Example result | Description | 
| --- | --- | --- | 
|  `${__from}`  |  1594671549254  |  Unix millisecond epoch  | 
|  `${__from:date}`  |  2020-07-13T20:19:09.254Z  |  No args, defaults to ISO 8601/RFC 3339  | 
|  `${__from:date:iso}`  |  2020-07-13T20:19:09.254Z  |  ISO 8601/RFC 3339  | 
|  `${__from:date:seconds}`  |  1594671549  |  Unix seconds epoch  | 
|  `${__from:date:YYYY-MM}`  |  2020-07  |  Any custom date format that does not include the : character  | 

The syntax above also works with `${__to}`.

**\$1\$1\$1interval**

You can use the `$__interval` variable as a parameter to group by time (for InfluxDB, MySQL, Postgres, MSSQL), Date histogram interval (for Elasticsearch), or as a *summarize* function parameter (for Graphite).

Grafana automatically calculates an interval that can be used to group by time in queries. When there are more data points than can be shown on a graph, the queries can be made more efficient by grouping by a larger interval. For example, if you are looking at a graph of 3 months worth of data, you might not be able to see detail at the minute level. Grouping by the hour or day makes the query more efficient without affecting what the graph shows. The `$__interval` is calculated using the time range and the width of the graph (the number of pixels).

Approximate Calculation: `(to - from) / resolution`

For example, when the time range is 1 hour and the graph is full screen, then the interval might be calculated to `2m` - points are grouped in 2 minute intervals. If the time range is 6 months and the graph is full screen, then the interval might be `1d` (1 day) - points are grouped by day.

In the InfluxDB data source, the legacy variable `$interval` is the same variable. `$__interval` should be used instead.

The InfluxDB and Elasticsearch data sources have `Group by time interval` fields that are used to hard code the interval or to set the minimum limit for the `$__interval` variable (by using the `>` syntax -> `>10m`).

**\$1\$1\$1interval\$1ms**

This variable is the `$__interval` variable in milliseconds, not a time interval formatted string. For example, if the `$__interval` is `20m` then the `$__interval_ms` is `1200000`.

**\$1\$1\$1org**

This variable is the ID of the current organization. `${__org.name}` is the name of the current organization.

**\$1\$1\$1user**

`${__user.id}` is the ID of the current user. `${__user.login}` is the login handle of the current user. `${__user.email}` is the email for the current user.

**\$1\$1\$1range**

Currently only supported for Prometheus and Loki data sources. This variable represents the range for the current dashboard. It is calculated by `to - from`. It has a millisecond and a second representation called `$__range_ms` and `$__range_s`.

**\$1\$1\$1rate\$1interval**

Currently only supported for Prometheus data sources. The `$__rate_interval` variable is meant to be used in the rate function.

**\$1timeFilter or \$1\$1\$1timeFilter**

The `$timeFilter` variable returns the currently selected time range as an expression. For example, the time range interval `Last 7 days` expression is `time > now() - 7d`.

This is used in several places, including:
+ The WHERE clause for the InfluxDB data source. Grafana adds it automatically to InfluxDB queries when in Query Editor mode. You can add it manually in Text Editor mode: `WHERE $timeFilter`.
+ Log Analytics queries in the Azure Monitor data source.
+ SQL queries in MySQL, Postgres, and MSSQL.
+ The `$__timeFilter` variable is used in the MySQL data source.

## Chained variables
<a name="v9-dash-variable-add-chained"></a>

*Chained variables*, also called *linked variables* or *nested variables*, are query variables with one or more other variables in their variable query. This section explains how chained variables work and provides links to example dashboards that use chained variables.

Chained variable queries are different for every data source, but the premise is the same for all. You can use chained variable queries in any data source that allows them.

Extremely complex linked templated dashboards are possible, 5 or 10 levels deep. Technically, there is no limit to how deep or complex you can go, but the more links you have, the greater the query load.

**Best practices and tips**

The following practices will make your dashboards and variables easier to use.

**Creating new linked variables**
+ Chaining variables create parent/child dependencies. You can envision them as a ladder or a tree.
+ The easiest way to create a new chained variable is to copy the variable that you want to base the new one on. In the variable list, click the **Duplicate variable** icon to the right of the variable entry to create a copy. You can then add on to the query for the parent variable.
+ New variables created this way appear at the bottom of the list. You might need to drag it to a different position in the list to get it into a logical order.

**Variable order**

You can change the orders of variables in the dashboard variable list by clicking the up and down arrows on the right side of each entry. Grafana lists variable dropdowns left to right according to this list, with the variable at the top on the far left.
+ List variables that do not have dependencies at the top, before their child variables.
+ Each variable should follow the one it is dependent on.
+ Remember there is no indication in the UI of which variables have dependency relationships. List the variables in a logical order to make it easy on other users (and yourself).

**Complexity consideration**

The more layers of dependency you have in variables, the longer it will take to update dashboards after you change variables.

For example, if you have a series of four linked variables (country, Region, server, metric) and you change a root variable value (country), then Grafana must run queries for all the dependent variables before it updates the visualizations in the dashboard.

## Manage variables
<a name="v9-dash-variable-add-manage"></a>

The variables page lets you [add](https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/) variables and manage existing variables. It also allows you to [inspect](https://grafana.com/docs/grafana/latest/dashboards/variables/inspect-variable/) variables and identify whether a variable is being referenced (or used) in other variables or dashboard.

**Move:** You can move a variable up or down the list using drag and drop.

**Clone:** To clone a variable, click the clone icon from the set of icons on the right. This creates a copy of the variable with the name of the original variable prefixed with `copy_of_`.

**Delete:** To delete a variable, click the trash icon from the set of icons on the right.

## Filter variables with regex
<a name="v9-dash-variable-add-filter"></a>

Using the Regex Query option, you filter the list of options returned by the variable query or modify the options returned.

This page shows how to use regex to filter/modify values in the variable dropdown.

Using the Regex Query Option, you filter the list of options returned by the Variable query or modify the options returned. For more information, refer to the Mozilla guide on [Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).

The following examples show filtering on the following list of options

```
backend_01
backend_02
backend_03
backend_04
```

**Filter so that only the options that end with `01` or `02` are returned**

Regex:

```
/
(
01|02 
) 
$/
```

Result:

```
backend_01
backend_02
```

**Filter and modify the options using a regex capture group to return part of the text**

Regex:

```
/.* 
(
01|02 
)
/
```

Result:

```
01
02
```

**Filter and modify - Prometheus Example**

List of options:

```
up{instance="demo.robustperception.io:9090",job="prometheus"} 1 1521630638000
up{instance="demo.robustperception.io:9093",job="alertmanager"} 1 1521630638000
up{instance="demo.robustperception.io:9100",job="node"} 1 1521630638000
```

Regex:

```
/. *instance="
(
[^"]*
)
.*/
```

Result:

```
demo.robustperception.io:9090
demo.robustperception.io:9093
demo.robustperception.io:9100
```

**Filter and modify using named text and value capture groups**

Using named capture groups, you can capture separate ’text’ and ‘value’ parts from the options returned by the variable query. This allows the variable dropdown list to contain a friendly name for each value that can be selected.

For example, when querying the `node_hwmon_chip_names` Prometheus metric, the `chip_name` is a lot friendlier that the `chip` value. So the following variable query result:

```
node_hwmon_chip_names{chip="0000:d7:00_0_0000:d8:00_0",chip_name="enp216s0f0np0"} 1
node_hwmon_chip_names{chip="0000:d7:00_0_0000:d8:00_1",chip_name="enp216s0f0np1"} 1
node_hwmon_chip_names{chip="0000:d7:00_0_0000:d8:00_2",chip_name="enp216s0f0np2"} 1
node_hwmon_chip_names{chip="0000:d7:00_0_0000:d8:00_3",chip_name="enp216s0f0np3"} 1
```

Passed through the following Regex:

```
/chip_name="(?<text>[ ^ " ] + ) |chip=" (?<value >[ ^ " ] + )/g
```

Would produce the following dropdown list:

```
Display Name          Value
------------          -------------------------
enp216s0f0np0         0000:d7:00_0_0000:d8:00_0
enp216s0f0np1         0000:d7:00_0_0000:d8:00_1
enp216s0f0np2         0000:d7:00_0_0000:d8:00_2
enp216s0f0np3         0000:d7:00_0_0000:d8:00_3
```

Only `text` and `value` capture group names are supported.

## 
<a name="v9-dash-variable-add-inspect"></a>

The variables page lets you easily identify whether a variable is being referenced (or used) in other variables or dashboard.

Any variable that is referenced or used has a green check mark next to it, while unreferenced variables have an orange caution icon next to them. In addition, all referenced variables have a dependency icon next to the green check mark. You can select the icon to view the dependency map. The dependency map can be moved. You can zoom in or out with the mouse wheel or equivalent.

# Variable syntax
<a name="v9-dash-variable-syntax"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Panel titles and metric queries can refer to variables using two different syntaxes.
+ `$varname` – This syntax is easy to read, but it does not allow you to use a variable in the middle of a word.

  **Example:** `apps.frontend.$server.requests.count`
+ `${var_name}` – Use this syntax when you want to use a variable in the middle of an expression.
+ `${var_name:<format>}` – This format gives you more control over how Grafana interprets values. For more information, see *Advanced variable format options*.
+ `[[varname]]` – Do not use. This syntax is old and has been deprecated. It will be removed in a future release.

Before queries are sent to your data source the query is *interpolated*, meaning the variable is replaced with its current value. During interpolation, the variable value might be *escaped* in order to conform to the syntax of the query language and where it is used. For example, a variable used in a regex expression in an InfluxDB or Prometheus query will be regex escaped.

**Advanced variable format options**

The formatting of the variable interpolation depends on the data source, but there are some situations where you might want to change the default formatting.

For example, the default for the MySQL data source is to join multiple values as comma-separated with quotes: `'server01','server02'`. In some cases, you might want to have a comma-separated string without quotes: `server01,server02`. You can make that happen with advanced variable formatting options listed below.

**General syntax**

Syntax: `${var_name:option}`

If any invalid formatting option is specified, then `glob` is the default/fallback option.

**CSV**

Formats variables with multiple values as a comma-separated string.

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:csv}'
Interpolation result:  'test1,test2'
```

**Distributed - OpenTSDB**

Formats variables with multiple values in custom format for OpenTSDB.

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:distributed}'
Interpolation result:  'test1,servers=test2'
```

**Doublequote**

Formats single- and multi-valued variables into a comma-separated string, escapes `"` in each value by `\"` and quotes each value with `"`.

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:doublequote}'
Interpolation result:  '"test1","test2"'
```

**Glob - Graphite**

Formats variables with multiple values into a glob (for Graphite queries).

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:glob}'
Interpolation result:  '{test1,test2}'
```

**JSON**

Formats variables with multiple values as a comma-separated string.

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:json}'
Interpolation result:  '["test1", "test2"]'
```

**Lucene - Elasticsearch**

Formats variables with multiple values in Lucene format for Elasticsearch.

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:lucene}'
Interpolation result:  '("test1" OR "test2")'
```

**Percentencode**

Formats single and multivalued variables for use in URL parameters.

```
servers = [ 'foo()bar BAZ',  'test2' ]
String to interpolate:  '${servers:percentencode}'
Interpolation result:  'foo%28%29bar%20BAZ%2Ctest2'
```

**Pipe**

Formats variables with multiple values into a pipe-separated string.

```
servers = [ 'test1.',  'test2' ]
String to interpolate:  '${servers:pipe}'
Interpolation result:  'test1.|test2'
```

**Raw**

Turns off data source-specific formatting, such as single quotes in an SQL query.

```
servers = [ 'test.1',  'test2' ]
String to interpolate:  '${var_name:raw}'
Interpolation result:  'test.1,test2'
```

**Regex**

Formats variables with multiple values into a regex string.

```
servers = [ 'test1.',  'test2' ]
String to interpolate:  '${servers:regex}'
Interpolation result:  '(test1\.|test2)'
```

**Singlequote**

Formats single- and multi-valued variables into a comma-separated string, escapes `'` in each value by `\'` and quotes each value with `'`.

```
servers = [ 'test1',  'test2' ]
String to interpolate:  '${servers:singlequote}'
Interpolation result:  "'test1','test2'"
```

**Sqlstring**

Formats single- and multi-valued variables into a comma-separated string, escapes `'` in each value by `''` and quotes each value with `'`.

```
servers = [ "test'1",  "test2" ]
String to interpolate:  '${servers:sqlstring}'
Interpolation result:  "'test''1','test2'"
```

**Text**

Formats single- and multi-valued variables into their text representation. For a single variable, it will just return the text representation. For multi-valued variables, it will return the text representation combined with `+`.

```
servers = [ "test1",  "test2" ]
String to interpolate:  '${servers:text}'
Interpolation result:  "test1 + test2"
```

**Query parameters**

Formats single- and multi-valued variables into their query parameter representation. Example: `var-foo=value1&var-foo=value2`

```
servers = [ "test1",  "test2" ]
String to interpolate:  '${servers:queryparam}'
Interpolation result:  "var-servers=test1&var-servers=test2"
```

# Assessing dashboard usage
<a name="v9-dash-assess-dashboard-usage"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Usage insights enable you to have a better understanding of how your Grafana instance is used.

The usage insights feature collects a number of aggregated data and stores them in the database.
+ Dashboard views (aggregated and per user)
+ Data source errors
+ Data source queries

The aggregated data provides you access to several features, including dashboard and data source insights, presence indicator, sorting dashboards by using insights data, and visualizing usage insight data in a dashboard.

This feature also generates detailed logs that can be exported to Loki.

## Dashboard and data source insights
<a name="v9-dash-insights"></a>

For every dashboard and data source, you can access usage information.

**Dashboard insights**

To see dashboard usage information, click **Dashboard insights** in the top bar.

Dashboard insights show the following information.
+ **Stats**: The number of daily queries and errors for the past 30 days.
+ **Users & activity**: The daily view count for the last 30 days; last activities on the dashboard and recent users (with a limit of 20).

**Data source insights**

Data source insights provide information about how a data source has been used in the past 30 days, such as:
+ Queries per day
+ Errors per day
+ Query load time per day (averaged in ms)

To find data source insights:

1. Go to the **Data source** list view.

1. Click on **Data source**.

1. Click the **Insights** tab.

## Presence indicator
<a name="v9-dash-presence-indicator"></a>

When you sign in and look at a dashboard, you can know who is looking at the same dashboard as you are through a presence indicator, which displays avatars of users who have recently interacted with the dashboard. The default timeframe is 10 minutes. To see the user’s name, hover over the user’s avatar. The avatars come from [Gravatar](https://gravatar.com/) based on the user’s email.

When there are more active users on a dashboard than can fit within the presence indicator, click the **\$1X** icon. Doing this will open dashboard insights, which contain more details about recent user activity.

## Sorting dashboards by using insights data
<a name="v9-dash-sort-dashboards"></a>

In the search view, you can use insights data to help you find most-used, broken, and unused dashboards.
+ Errors total
+ Errors 30 days
+ Views total
+ Views 30 days

# Searching Dashboards in Grafana version 9
<a name="v9-search"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

You can search for dashboards by dashboard name and by panel title. When you search for dashboards, the system returns all dashboards available within the Grafana instance, even if you do not have permission to view the contents of the dashboard.

## Search dashboards using dashboard name
<a name="v9-search-by-name"></a>

Enter any part of the dashboard name in the search bar. The search returns results for any partial string match in real-time, as you type.

Dashboard search is:
+ Real-time
+ *Not* case sensitive
+ Functional across stored and file based dashboards.

**Tip**  
You can use your keyboard arrow keys to navigate the results and press `Enter` to open the selected dashboard.

## Search dashboards using panel title
<a name="v9-search-by-title"></a>

You can search for a dashboard by the title of a panel that appears in a dashboard. If a panel’s title matches your search query, the dashboard appears in the search results.

## Filter dashboard search results by tags
<a name="v9-search-by-tag"></a>

Tags are a great way to organize your dashboards, especially as the number of dashboards grow. You can add and manage tags in dashboard **Settings**.

When you select multiple tags, Grafana shows dashboards that include all selected tags.

To filter dashboard search result by a tag, complete one of the following steps:
+ To filter dashboard search results by tag, choose a tag that appears in the right column of the search results.

  You can continue filtering by choosing additional tags.
+ To see a list of all available tags, click the **Filter by tags** dropdown menu and select a tag.

  All tags will be shown, and when you select a tag, the dashboard search will be instantly filtered.

**Tip**  
When using only a keyboard, press the `tab` key and navigate to the **Filter by tag** dropdown menu, press the down arrow key to activate the menu and locate a tag, and press `Enter` to select the tag.