Grafana: Templating: Reuse template variable definitions across dashboards

Created on 7 May 2015  ·  122Comments  ·  Source: grafana/grafana

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:

  1. Create a new dashboard
  2. select option then features and pick template
  3. 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.

aredashboartemplating prioritimportant-longterm typfeature-request

Most helpful comment

Torkel, this is exteremely important for us, any chance you could prioritize this?

All 122 comments

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).

1) First reusable panes & panel templates across dashboards
2) Annotations
3) 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 :)

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1000

+1

+1 I think. I'm a grafana newbie so go easy ;-) Would this allow me to set a time range that would span all dashboards? I want to be able to view data for a particular time interval from different dashboards to get an integrated view of what happened then. If I click on some widget inside the dashboard that redirects me to another one, the time interval is preserved, but if I select a dashboard from a menu, the time interval is lost, and grafana documentation seems to be telling me there is nothing I can do about it but pound sand ;-{ . I would think other people would be interested in a feature like this. Can anyone suggest at least a hack that lets me try this behavior out and see if it works?

+1

+1

+10086

+1 顶

+1

@torkelo As per 2015: "How do you define 'a lot'?" ;)

@bergquist this is over 9000, now.

@torkelo As per 2015: "How do you define 'a lot'?" ;)

This issue has definitely reached that threshold (of having a lot of +1 / thumbs up). But there are about 30 issues with even more thumbs up so the competition for feature requests with lots of demand is pretty high :)

I do think this feature makes a lot of sense, and would definitely like to see it implemented. Not sure when we will time to work on it, maybe early next year.

Valid point. Do you have a public list of "this is what we want, in this order, and those are the bits we are working on"? This could be linked from the issues so people know it's accepted.

Also, tagging issues as "accepted, will happen at some point" would help.

updated our roadmap: https://github.com/grafana/grafana/blob/master/ROADMAP.md it is very broad and not very detailed yet.

@torkelo LOL, you were not kidding when you said "very broad" ;-)

But, thank you for starting the process though ... I think anything you can do to communicate the direction you are going will help to improve the quality of feedback from the community.

Thanks again for all the work you are doing with this project.

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1
This would be super useful for deployment across environments.

well. +1

+1

Please make it so

To anyone interested in this feature, please prefer adding a reaction to the initial post instead of posting a "+1" comment. This makes it easier for everyone to track how much people want this.

Is this by any chance happening soon? It would be extremely useful.

Thanks!

I'd also highly appreciate this feature!

I'd like this feature aswell.

we would also find this quite useful!

+1

+1

+1 Any updates on the priority of implementing this feature? Would significantly cut down on time and allow for increased dashboard modularity and reusability across deploys.

Also need this, being able to define variables at user level (in user accounts), which could then be used in dashboard templates.
We could then have one dashboard template for all users, each user seing its own / customized data.
Thx 👍

Not sure if this has been addressed - but ideally I don't think these should be global variables. Within one instance I may have groups of dashboards that have identical variable needs, but different from those of other groups of dashboards. As is often the case, global variables can cause problems.

I think what would be more ideas is to have "Variable Groups" with a set of variables and each dashboard can have the group needed.

There are questions like - can I add specific variables to a dashboard that already has a variable group. Would it be possible to have multiple variable groups for a dashboard, etc. I would opt for the simplest approach for now.

+1

+1 Any updates on the priority of implementing this feature? Would really like to have a central way to manage dashboards. Thanks

+1 This feature would be awesome and significantly cut down on the headaches associated with managing 20+ dashboards.

+1

+1 please this would make my work a lot easier

+1 what's the priority on this?

+1

+1

+1

+1

+1

+1, maintaining panels duplicated across dashboards is a pain.

Starting to build out my OTRS dashboard with 'sub' dashboards and this would be really handy, for sure!

+1

+1 for shared pannel, 1 small change in query needs to be updated in 40+ dashboards is a pain.

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmetkakici picture ahmetkakici  ·  3Comments

Azef1 picture Azef1  ·  3Comments

royemmerich picture royemmerich  ·  3Comments

kcajf picture kcajf  ·  3Comments

KlavsKlavsen picture KlavsKlavsen  ·  3Comments