Back to Grafana

Dashboard controls

docs/sources/visualizations/dashboards/build-dashboards/create-dashboard/dashboard-controls.md

13.1.08.1 KB
Original Source

Dashboard controls

In the Dashboard controls section of the sidebar, you can add variables, annotation queries, dashboard links, and controls to filter and group data, without leaving the dashboard.

{{< figure src="/media/docs/grafana/dashboards/screenshot-dashboard-controls-v13.1.png" max-width="400px" alt="Dashboard controls in the Dashboard options sidebar view" >}}

Add filters and group by controls

<!-- vale Grafana.WordList = NO --> <!-- vale Grafana.Spelling = NO -->

{{< admonition type="note" >}} The Filter and Group by feature renames the Ad hoc filters variable and extends it by adding grouping for Prometheus and Loki data sources. However, in the dashboard schema, it's still referred to as "kind": "AdhocVariable" under the variables schema property. {{< /admonition >}}

<!-- vale Grafana.WordList = YES --> <!-- vale Grafana.Spelling = YES -->

{{< shared-snippet path="/docs/grafana/<GRAFANA_VERSION>/visualizations/dashboards/build-dashboards/filter-group-by/index.md" id="add-filter-group-by" >}}

For more detailed information on the Filter and Group by option, refer to the full Filter and group by controls documentation.

Add variables

To add a variable, follow these steps:

{{< docs/list >}}

  1. Navigate to the dashboard you want to update.

  2. Click Edit.

  3. Click + Add variable at the top of the dashboard or click the Add new element icon (blue plus sign) and select Variable.

  4. Choose a variable type from the list.

    You can update the variable type by clicking Change type in the sidebar.

{{< shared-snippet path="/docs/grafana/<GRAFANA_VERSION>/visualizations/dashboards/variables/add-template-variables/index.md" id="add-variable" >}}

  1. Complete the variable configuration. For more detailed configuration information, click the one of the following links to complete the steps for adding your selected variable type:

{{< column-list >}}

{{< /column-list >}}

  1. Click Save.
  2. (Optional) Enter a description of the changes you've made.
  3. Click Save.
  4. Click Exit edit.

{{< /docs/list >}}

For more detailed information on variables, refer to the full Variables documentation.

Add annotation queries

To add an annotation query, follow these steps:

{{< docs/list >}}

  1. Navigate to the dashboard you want to update.

  2. Click Edit.

  3. Click the Add new element icon (blue plus sign).

  4. Click Annotation query.

  5. Enter a name for the annotation query.

    This name is given to the toggle that allows you to enable/disable showing annotation events from this query.

{{< shared-snippet path="/docs/grafana/<GRAFANA_VERSION>/visualizations/dashboards/build-dashboards/annotate-visualizations/index.md" id="add-annotation-query" >}}

  1. To add a query, do one of the following:

    • Click Open query editor to open Annotation Query dialog box and write or construct a query. The annotation query options are different for each data source. For information about annotations in a specific data source, refer to the specific data source topic.
    • Click Use saved query to open a the Saved queries drawer and select a saved query.

    {{< admonition type="note" >}} Saved queries is currently in public preview in Grafana Enterprise and Grafana Cloud only. {{< /admonition >}}

  2. (Optional) Click Test annotation query to ensure that the query is working properly.

  3. Click Close when you've completed the query setup.

  4. Click Save.

  5. (Optional) Enter a description of the changes you've made.

  6. Click Save.

  7. Click Exit edit.

{{< /docs/list >}}

For more detailed information about annotations, refer to the full Annotations documentation.

For more detailed information on dashboard links, refer to the full Dashboard links documentation.

To add a link to another dashboard at the top of your current dashboard, follow these steps:

{{< docs/list >}}

  1. Navigate to the dashboard you want to update.
  2. Click Edit.
  3. Click the Add new element icon (blue plus sign).
  4. Click Link.

{{< shared-snippet path="/docs/grafana/<GRAFANA_VERSION>/visualizations/dashboards/build-dashboards/manage-dashboard-links/index.md" id="add-dashboard-link" >}}

  1. Click Save.
  2. (Optional) Enter a description of the changes you've made.
  3. Click Save.
  4. Click Exit edit.

{{< /docs/list >}}

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.

To add a URL link to your dashboard, follow these steps:

{{< docs/list >}}

  1. Navigate to the dashboard you want to update.
  2. Click Edit.
  3. Click the Add new element icon (blue plus sign).
  4. Click Link.

{{< shared-snippet path="/docs/grafana/<GRAFANA_VERSION>/visualizations/dashboards/build-dashboards/manage-dashboard-links/index.md" id="url-dashboard-link" >}}

  1. Click Save.
  2. (Optional) Enter a description of the changes you've made.
  3. Click Save.
  4. Click Exit edit.

{{< /docs/list >}}

Manage dashboard controls

After you add dashboard controls, you can manage them from the dashboard options. In this view, the sidebar includes collapsible sections for filters, variables, annotations, and links, including hidden controls that aren't otherwise visible on the dashboard:

{{< figure src="/media/docs/grafana/dashboards/screenshot-dashboard-controls-mgmt-v13.1.png" max-width="450px" alt="Dashboard controls in the Dashboard options sidebar view" >}}

To manage dashboard controls, follow these steps:

  1. Click the Dashboard options icon in the sidebar.

  2. In the sidebar, expand the appropriate collapsible section.

  3. Do one or more of the following:

    • Edit: Click Select on the control to open it in the sidebar so you can make updates.
    • Reorder: Drag and drop controls to reorder them.
    • Change display: Drag and drop controls between sub-sections Above dashboard, Controls menu, and Hidden to update the control display option. Note that links can't be hidden.

    {{< admonition type="tip" >}} To get back to controls management from configuration, click the Dashboard options icon. {{< /admonition >}}

  4. Make any other changes as needed.

  5. Click Save.

  6. (Optional) Enter a description of the changes you've made.

  7. Click Save.

  8. Click Exit edit.