# Testing globalDashboardVariables

**URL:** <https://community.grafana.com/t/testing-globaldashboardvariables/164300>\
**Category:** Grafana\
**Tags:** dashboard-variables\
**Created:** [September 1, 2026, 6:18am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300 "2026-09-01T06:18:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephenking](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/stephenking/32/20476_2.png) [@stephenking](https://community.grafana.com/u/stephenking)\
**Post date:** [September 1, 2026, 6:18am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/1 "2026-09-01T06:18:23Z")

</div>

Hi,

I know it wasn’t mentioned in the Grafana 13.2 release notes, but I noticed that there were new features added behind the `globalDashboardVariables` feature flag, which allows to define dashboard variables on global / folder scope. That’s nicely described in [this PR](https://github.com/grafana/grafana/pull/127821).

Unfortunately, setting the toggle didn’t show me the menu item Dashboards \> Variables.

Can anyone guide me to how it can be used already in the early stage? It’s for us a super helpful feature, as we want to evaluate Git Sync and avoid Terraform templating during dashboard provisioning..

Thanks  
Steffen

---

<div class="post-metadata">

**Author:** ![stephenking](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/stephenking/32/20476_2.png) [@stephenking](https://community.grafana.com/u/stephenking)\
**Post date:** [September 1, 2026, 6:38am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/2 "2026-09-01T06:38:23Z")

</div>

I noticed that a few weeks later, an OpenFeature-based toggle has [been added](https://github.com/grafana/grafana/blob/2d289f63d515a7ba6b2a3a793bead4e6d6c02748/pkg/services/featuremgmt/toggles_gen.csv#L265-L266):

> <https://github.com/grafana/grafana/blob/2d289f63d515a7ba6b2a3a793bead4e6d6c02748/pkg/services/featuremgmt/toggles_gen.csv#L265-L266>

Just not sure how to specify those. I tried the following Helm chart values config, but this resulted in _Settings_ UI showing `map[dashboardGlobalVariables:true]`:

```auto
  feature_toggles:
    grafana:
      dashboardGlobalVariables: true

```

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [September 1, 2026, 8:34am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/3 "2026-09-01T08:34:43Z")

</div>

I would try different syntax on the helm level:

```auto
  feature_toggles:
    "grafana.dashboardGlobalVariables": true

```

---

<div class="post-metadata">

**Author:** ![stephenking](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/stephenking/32/20476_2.png) [@stephenking](https://community.grafana.com/u/stephenking)\
**Post date:** [September 1, 2026, 10:33am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/4 "2026-09-01T10:33:24Z")

</div>

thanks, that worked!

Now I’m just trying to make the feature work. So far I couldn’t access those variables in my dashboard. Anyone knows if that should already work?

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [September 1, 2026, 11:02am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/5 "2026-09-01T11:02:57Z")

</div>

Was Grafana restarted properly?  
Do you work with V2 dashboards (dashboard schema v2)?

LLM advice:

> Once enabled:
> 
> 1. **Dashboards → Variables** nav item appears under the Dashboards section (for org-wide variable management at `/dashboards/variables`).
> 2. Global and folder-scoped variables defined via `dashboard.grafana.app/v2beta1` are **automatically injected** into every V2 dashboard at load time.
> 3. A **“Predefined variables”** option appears in the dashboard sidebar to control which global/folder variables a dashboard inherits (`None`, `All`, or specific ones).

It is still experimental:

> <https://github.com/grafana/grafana/blob/b90921a7f78722349e4c5bf8f953d5a5f2a3ccc4/pkg/services/featuremgmt/registry.go#L2268-L2273>

So I would say you (your AI agent) need to read source code to find how it works.

---

<div class="post-metadata">

**Author:** ![stephenking](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/stephenking/32/20476_2.png) [@stephenking](https://community.grafana.com/u/stephenking)\
**Post date:** [September 1, 2026, 3:23pm UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/6 "2026-09-01T15:23:28Z")

</div>

Thanks for checking this. Indeed.. the last piece I did not expect.

 ![Screenshot 2026-09-01 at 17.22.37](https://us1.discourse-cdn.com/grafana/original/3X/f/6/f613f2749c99f4dc9bd74f95e78bcd727579f169.png)

---

<div class="post-metadata">

**Author:** ![harisrozajac](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/harisrozajac/32/58999_2.png) [@harisrozajac](https://community.grafana.com/u/harisrozajac)\
**Post date:** [October 16, 2026, 9:00pm UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/7 "2026-10-16T21:00:45Z")

</div>

Hi @stephenking, thank you so much for looking into global dashboard variables!

We have changed the UI a bit, and global/folder variables are now added to a dashboard through the regular dashboard options pane. More detail here [Define variables once, use them across dashboards | Grafana Labs](https://grafana.com/whats-new/2026-10-14-define-variables-once--use-them-across-dashboards/)

Global dashboard variables were an experimental feature until 13.3, that’s why they were not mentioned in 13.2 release notes. And sorry about the confusion with the feature flag! We switched to OpenFeature and had to rename the flag.

And yeah you can provision them through Terraform using [grafana\_apps\_generic\_resource](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/apps_generic_resource). For example:

```auto
# Folder used only by the folder-scoped variable below.
resource "grafana_folder" "shared" {
  title = "Shared variables demo"
  uid = "tf-cross-dash-vars"
}

# Global constant: available to every opted-in dashboard in the stack/org.
# metadata.name must equal spec.spec.name.
resource "grafana_apps_generic_resource" "env" {
  manifest = {
    apiVersion = "dashboard.grafana.app/v2beta1"
    kind = "Variable"
    metadata = {
      name = "env"
    }
    spec = {
      kind = "ConstantVariable"
      spec = {
        name = "env"
        query = "prod"
      }
    }
  }
}

# Global custom list: $region
resource "grafana_apps_generic_resource" "region" {
  manifest = {
    apiVersion = "dashboard.grafana.app/v2beta1"
    kind = "Variable"
    metadata = {
      name = "region"
    }
    spec = {
      kind = "CustomVariable"
      spec = {
        name = "region"
        query = "us-east-1,us-west-2,eu-west-1"
        current = { text = "us-east-1", value = "us-east-1" }
        options = []
        multi = false
        includeAll = false
        hide = "dontHide"
        skipUrlSync = false
        allowCustomValue = true
      }
    }
  }
}

# Folder-scoped custom list: $cluster
# metadata.name must be "<specName>--<folderUID>".
# Scope cannot change later — rename or move is delete + recreate.
resource "grafana_apps_generic_resource" "cluster" {
  manifest = {
    apiVersion = "dashboard.grafana.app/v2beta1"
    kind = "Variable"
    metadata = {
      name = "cluster--tf-cross-dash-vars"
      annotations = {
        "grafana.app/folder" = grafana_folder.shared.uid
      }
    }
    spec = {
      kind = "CustomVariable"
      spec = {
        name = "cluster"
        query = "prod,staging"
        current = { text = "prod", value = "prod" }
        options = []
        multi = false
        includeAll = false
        hide = "dontHide"
        skipUrlSync = false
        allowCustomValue = true
      }
    }
  }

  depends_on = [grafana_folder.shared]
}

```

We don’t have support for git sync yet though, and we will evaluate once we rollout this to all of our users.

---

<div class="post-metadata">

**Author:** ![stephenking](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/stephenking/32/20476_2.png) [@stephenking](https://community.grafana.com/u/stephenking)\
**Post date:** [October 19, 2026, 8:39am UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/8 "2026-10-19T08:39:49Z")

</div>

Thanks @harisrozajac , I appreciate your response!

We’ve been playing around with the feature and discussed, how it would finally allow us to switch to Git Sync (as we currently have Terraform to parametrize dashboards for our different Grafana deployments).

Not sure if it’s exactly what you said with “don’t have support for git sync yet”, but we also noticed the shortcomings of

- every dashboard needs to be changed to make use of variables
- setting is not in the dashboard schema

Will it be long-term the case that one doesn’t have to change every dashboard to incorporate global variables? Or should I open an issue for that?

---

<div class="post-metadata">

**Author:** ![harisrozajac](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/harisrozajac/32/58999_2.png) [@harisrozajac](https://community.grafana.com/u/harisrozajac)\
**Post date:** [October 19, 2026, 2:23pm UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/9 "2026-10-19T14:23:25Z")

</div>

I meant we currently don’t support managing global variables in Git Sync, but if there’s interest, we could implement that.

> every dashboard needs to be changed to make use of variables

This is expected because creating a global variable would make it show in every dashboard in a Grafana instance (even on dashboards where a global variable doesn’t apply), which would be disruptive, especially for instances with 1000s of dashboards. On top of that, every time a user creates a new global variable, that variable would again show up in all dashboards, and users would have to opt out specifically.

> Setting is not in the dashboard schema

This is also expected because we reference these variables by name in the Dashboard resource’s `metadata.annotations.grafana.app/useCrossDashboardVariables`. Apologies for not including an example of how to reference it in my previous reply. Here it is:

```auto
resource "grafana_apps_generic_resource" "demo_dashboard" {
  manifest = {
    apiVersion = "dashboard.grafana.app/v2"
    kind = "Dashboard"
    metadata = {
      name = "tf-cross-dash-vars-demo"
      annotations = {
        "grafana.app/folder" = grafana_folder.shared.uid
        # JSON string. "all" auto-includes new vars in that scope; a name list does not.
        "grafana.app/useCrossDashboardVariables" = jsonencode({
          global = ["env", "region"]
          folder = ["cluster"]
        })
      }
    }
    spec = {
      title = "Cross-dashboard variables demo"
      cursorSync = "Off"
      preload = false
      elements = {}
      layout = { kind = "GridLayout", spec = { items = [] } }
      timeSettings = {
        timezone = "browser"
        from = "now-6h"
        to = "now"
      }
    }
  }
}

```

I hope this helps, feel free to reach out with any additional questions.

---

<div class="post-metadata">

**Author:** ![stephenking](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/stephenking/32/20476_2.png) [@stephenking](https://community.grafana.com/u/stephenking)\
**Post date:** [October 19, 2026, 2:50pm UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/10 "2026-10-19T14:50:46Z")

</div>

Thanks for your response. Let me explain our use case / idea how we replace Terraform for dashboard provisioning with Git Sync. Using TF is cumbersome, as we have to export dashboard JSON and escape all `${` so that TF doesn’t try to substitute Grafana variables. Git Sync looks soo much better.

We work with multiple Grafana deployments, all showing the same dashboards across isolated deployments (of production systems AND separate Grafanas). Imagine those would be for a hand full of customers. So we have a **TF** variable `${customer}` in the dashboard JSON, which is replaced by Terraform with `customer-a`. This value is then often used to construct identifiers in AWS or query based on Prometheus labels `customer=“${customer}”`.

If we now switch to Git Sync, we would still need some way to have parametrization of `$customer`, with Grafana-deployment specific value. We thought that a global variable would be perfect for this so that no longer TF replaces it, but Grafana.

I understand that having variables shown for every dashboard - in our case we would use _hidden_ variables. Would it then make sense for you to be able to declare the variable as to be used across all dashboards? I think there was no way to create a dashboard with a reference to global variables, share it via Git Sync, and then just use it in the other Grafana deployments. That setting was not carried over (as you describe).

I hope my description now makes more sense to you.

---

<div class="post-metadata">

**Author:** ![harisrozajac](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/harisrozajac/32/58999_2.png) [@harisrozajac](https://community.grafana.com/u/harisrozajac)\
**Post date:** [October 22, 2026, 2:14pm UTC](https://community.grafana.com/t/testing-globaldashboardvariables/164300/11 "2026-10-22T14:14:37Z")

</div>

Thank you for clarifying this. That use case makes sense, and just to make sure, this is how I understand it. The dashboards stay identical, and the only thing that changes per Grafana is the value of `$customer`, which Terraform substitutes today before the JSON is loaded. A hidden global variable is the right replacement for that. Git Sync holds the dashboards, the value of `$customer` stays on each Grafana.

> I think there was no way to create a dashboard with a reference to global variables, share it via Git Sync, and then just use it in the other Grafana deployments.

There’s a way to do this, full Dashboard resource can carry it, so you would do something like this for Git Sync:

```auto
{
  "apiVersion": "dashboard.grafana.app/v2",
  "kind": "Dashboard",
  "metadata": {
    "name": "overview",
    "annotations": {
      "grafana.app/useCrossDashboardVariables": "{\"global\":[\"customer\"]}"
    }
  },
  "spec": { the actual dashboard content - what is in the schema }
}

```

Are your dashboards written in the v2 schema or the old schema?
