Templating: Reuse template variable definitions across dashboards
Torkel,
Is it possible to create global templates rather than a particular dashboard based templates. This is what I mean. Currently, I do this step to create template based dashboard:
- Create a new dashboard
- select option then features and pick template
- I can only use this template with this dashboard.
Is it possible to create global templates? So that an SME will create the templates, and users will only pick the template names from the query to build charts? I hope I am clear.
yea, with Grafana 2.0 and the new backend, it would be possible in a future release (maybe next year or this winter), to add template variables as independent entities that you can reuse across dashboards.
Torkel, this is exteremely important for us, any chance you could prioritize this?
no, maybe if it would get a lot of +1 :) People have been fine without centralized storage of template vars this far, just define them for one dashboard and then copy that dashboard. Not ideal.
The current roadmap for features like this (that is moving something out of dashboards and making them savable as separate entities, and reusable across dashboards).
- First reusable panes & panel templates across dashboards
- Annotations
- Annotations per panel
I feature like this needs a lot of +1 votes, then it might get added to a roadmap. You can write some code yourself that uses the HTTP api to sync template variables across many dashboards
:+1:
:+1:
+1
In my use case I have one template variable with predefined values, and used in 10+ dashboards. Making a change to 10 places every time is not fun!
+1
+1
+1
+1
@torkelo How do you define "a lot"?
- 1
+1
+1
+1
+1
+1 - I use some massive GLOB statements i.e. {entity1, entity2, entity3} which I use on multiple dashboards and they change fairly frequently and I have to update them in a half dozen dashboards. Global variables would be an amazing feature
:+1:
I am surprised there is not that many +1s. I am replicating a template variable queried from a Prometheus instance-label for every dashboard I create in this organisation ...
+1
+1
+1
+1
+1
+1
A quick workaround may be using wizzy CLI until we can get some major code refactoring to use template variables accross Grafana:
One may copy or move template variables from one dashboard to another - https://github.com/utkarshcmu/wizzy#local-commands
+1
wizzy 0.4.0 released... now you can extract template variables from any dashboard, store it and insert it in any dashboard.... https://github.com/utkarshcmu/wizzy#template-variables-commands
+1
+1
+1 +1 +1 :)