From 15c72c2739b6d445d5a9891029d66b6b4f1c0298 Mon Sep 17 00:00:00 2001 From: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Date: Wed, 2 Sep 2020 07:07:31 -0700 Subject: [PATCH] Docs: Updated data links content (#27110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * updated content * updated content * Update data-link-variables.md * Update global-variables.md * updated content * Update best-practices-for-managing-dashboards.md * Update docs/sources/linking/data-link-variables.md Co-authored-by: Torkel Ödegaard * Update docs/sources/linking/data-link-variables.md Co-authored-by: Torkel Ödegaard * Update docs/sources/linking/data-link-variables.md Co-authored-by: Torkel Ödegaard * Update docs/sources/linking/data-link-variables.md Co-authored-by: Torkel Ödegaard * Update docs/sources/linking/data-links.md Co-authored-by: Torkel Ödegaard * Update docs/sources/linking/dashboard-links.md Co-authored-by: Torkel Ödegaard * Update dashboard-links.md Co-authored-by: Torkel Ödegaard --- .../best-practices-for-managing-dashboards.md | 2 +- docs/sources/linking/dashboard-links.md | 2 +- docs/sources/linking/data-link-variables.md | 55 +++++++++++++++++++ docs/sources/linking/data-links.md | 10 +++- docs/sources/menu.yaml | 4 +- .../variables/templates-and-variables.md | 1 - .../variables/variable-types/_index.md | 3 +- .../variable-types/global-variables.md | 5 +- .../variables/variable-types/url-variables.md | 53 ------------------ 9 files changed, 72 insertions(+), 63 deletions(-) create mode 100644 docs/sources/linking/data-link-variables.md delete mode 100644 docs/sources/variables/variable-types/url-variables.md diff --git a/docs/sources/best-practices/best-practices-for-managing-dashboards.md b/docs/sources/best-practices/best-practices-for-managing-dashboards.md index b6cb7e529f1..8e3d5b7ddf6 100644 --- a/docs/sources/best-practices/best-practices-for-managing-dashboards.md +++ b/docs/sources/best-practices/best-practices-for-managing-dashboards.md @@ -31,7 +31,7 @@ What is your dashboard maturity level? Analyze your current dashboard setup and - If you create a temporary dashboard, perhaps to test something, prefix the name with `TEST: `. Delete the dashboard when you are finished. - Copying dashboards with no significant changes is not a good idea. - You miss out on updates to the original dashboard, such as documentation changes, bug fixes, or additions to metrics. - - In many cases copies are being made to simply customize the view by setting template parameters. This should instead be done by maintaining a link to the master dashboard and customizing the view with [URL parameters]({{< relref "../variables/variable-types/url-variables.md" >}}). + - In many cases copies are being made to simply customize the view by setting template parameters. This should instead be done by maintaining a link to the master dashboard and customizing the view with [URL parameters]({{< relref "../linking/data-link-variables.md" >}}). - When you must copy a dashboard, clearly rename it and _do not_ copy the dashboard tags. Tags are important metadata for dashboards that are used during search. Copying tags can result in false matches. - Maintain a dashboard of dashboards or cross-reference dashboards. This can be done in several ways: - Create dashboard links, panel, or data links. Links can go to other dashboards or to external systems. For more information, refer to [Linking]({{< relref "../linking/_index.md" >}}). diff --git a/docs/sources/linking/dashboard-links.md b/docs/sources/linking/dashboard-links.md index 402da2399eb..8f4c5a420fe 100644 --- a/docs/sources/linking/dashboard-links.md +++ b/docs/sources/linking/dashboard-links.md @@ -10,7 +10,7 @@ weight = 200 # 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 more information about specifying links, refer to [URL variables]({{< relref "../variables/variable-types/url-variables.md" >}}). +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, refer to [Data link variables]({{< relref "data-link-variables.md" >}}). 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). diff --git a/docs/sources/linking/data-link-variables.md b/docs/sources/linking/data-link-variables.md new file mode 100644 index 00000000000..b658067e25f --- /dev/null +++ b/docs/sources/linking/data-link-variables.md @@ -0,0 +1,55 @@ ++++ +title = "URL variables" +keywords = ["grafana", "url variables", "documentation", "variables", "data link"] +aliases = ["/docs/grafana/latest/variables/url-variables.md","/docs/grafana/latest/variables/variable-types/url-variables.md"] +type = "docs" +weight = 400 ++++ + +# Data link variables + +You can use variables in data links to refer to series fields, labels, and values. For more information about data links, refer to [Data links]({{< relref "data-links.md" >}}). + +To see a list of available variables, type `$` in the data link **URL** field to see a list of variables that you can use. + +> **Note:** These variables changed in 6.4 so if you have an older version of Grafana, then use the version picker to select docs for an older version of Grafana. + +You can also use template variables in your data links URLs, refer to [Templates and variables]({{< relref "../variables/templates-and-variables.md" >}}) for more information on template variables. + +## Time range panel variables + +These variables allow you to include the current time range in the data link URL. + +* ``__url_time_range`` - current dashboard's time range (i.e. ``?from=now-6h&to=now``) +* `$__from and $__to` - For more information, refer to [Global variables]({{< relref "../variables/variable-types/global-variables.md#__from-and-__to" >}}). + +## Series variables + +Series specific variables are available under ``__series`` namespace: + +* ``__series.name`` - series name to the URL +* ``__series.labels.