Grafana Cloud Enterprise Open source

Note

Cross-dashboard variables is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

To use this feature, enable the grafana.dashboardGlobalVariables feature toggle in your Grafana configuration file or contact Support.

Unlike variables that are specific to the dashboard in which you build them, you can create cross-dashboard variables for use across multiple dashboards. These variables help ensure consistent naming across your organization and eliminate the need to re-create the same variables every time you add a new dashboard.

You can scope cross-dashboard variables in two ways:

  • Globally: Available to all dashboards in the organization.
  • By folder: Available only to the dashboards in the same folder as the variable.

The Dashboards > Variables page lists cross-dashboard variables, showing which ones are available globally or by folder. In the following image, there are variables in “Core metrics” and “Grafana Cloud” folders and then a number of variables that aren’t in any folders; these ones are global:

Cross-dashboard variables page

When you add cross-dashboard variables to a dashboard, only the ones that share the same scope as your dashboard are available for you to select.

For example, in the preceding image, there are two variables in the “Core metrics” folder. The following image shows a dashboard in the “Core metrics” folder. As a result, the variables in the “Core metrics” folder are available to that dashboard, as well as all the global variables:

Available cross-dashboard variables in dashboard sidebar

Variables in other folders aren’t available to that dashboard.

Create cross-dashboard variables

To create cross-dashboard variables, follow these steps:

  1. Navigate to Dashboards > Variables.

  2. Click + New variable.

  3. Set the following general variable properties:

    OptionDescription
    FolderSet the availability of the variable. To allow the variable to be used in all of the organization’s dashboards, select Dashboards.
    Variable typeChoose a variable type.
    NameEnter a name for the variable.
    Label(Optional) Enter the display name for the variable drop-down list. If you leave this empty, then the variable name is used.
    Description

    (Optional) Enter a description of the variable. When you add a description, an info icon appears next to the variable name on the dashboard. Hover your cursor over the icon to display the description.

    Descriptions support links. You can use Markdown-style links like [link text](https://example.com), or paste bare URLs like https://example.com. Only http and https URLs render as clickable links—other protocols display as plain text.

    DisplayChoose where the variable displays:
    • Above dashboard: The variable drop-down list displays above the dashboard with the variable Name or Label value. This is the default.
    • Above dashboard, label hidden: The variable drop-down list displays above the dashboard, but without showing the name of the variable.
    • Controls menu: The variable displays in the dashboard controls menu instead of above the dashboard. The dashboard controls menu appears as a button in the dashboard toolbar.
    • Hidden: No variable drop-down list displays on the dashboard.
  4. Click one of the following links to complete the steps for adding your selected variable type:

Add cross-dashboard variables to a dashboard

You can choose which cross-dashboard variables to add to dashboards you create. Only variables that share the same scope as your dashboard are available for you to select.

To add cross-dashboard variables to a dashboard, follow these steps:

  1. Navigate to the dashboard you want to update.

  2. Click Edit.

  3. Click the Add new element icon in the sidebar and select Variable.

    You can also click the Add (plus sign) icon at the top of the dashboard and select Variable.

  4. Select the Global or folder variable variable type.

  5. Select the variables you want to add to the dashboard:

    Cross-dashboard variable selected and added above dashboard

    To add every global variable available, select All global and to add every folder variable available, select All folder.

  6. Update variable values as needed.

  7. Click Save.

  8. Enter an optional description of your changes and click Save.

  9. Click Exit edit.

After you’ve added cross-dashboard variables to a dashboard, you can view its settings or remove it by way of the dashboard sidebar. To edit the variable, go to Dashboards > Variables.