grafana icon indicating copy to clipboard operation
grafana copied to clipboard

Templating: Reuse template variable definitions across dashboards

Open gsaray101 opened this issue 10 years ago • 137 comments

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.

gsaray101 avatar May 07 '15 14:05 gsaray101

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.

torkelo avatar May 07 '15 18:05 torkelo

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

gsaray101 avatar May 07 '15 18:05 gsaray101

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

torkelo avatar May 07 '15 20:05 torkelo

:+1:

catacgc avatar May 10 '15 12:05 catacgc

:+1:

gsaray101 avatar May 11 '15 14:05 gsaray101

+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!

mvadu avatar Sep 28 '15 06:09 mvadu

+1

utkarshcmu avatar Oct 14 '15 16:10 utkarshcmu

+1

mtanda avatar Nov 08 '15 03:11 mtanda

+1

qqren avatar Dec 16 '15 05:12 qqren

+1

kaleparag avatar Dec 16 '15 14:12 kaleparag

@torkelo How do you define "a lot"?

RichiH avatar Dec 29 '15 09:12 RichiH

  • 1

feraudet avatar Jan 27 '16 14:01 feraudet

+1

sslupsky avatar Feb 26 '16 00:02 sslupsky

+1

sfleiter avatar Mar 09 '16 14:03 sfleiter

+1

gilgamezh avatar Apr 02 '16 17:04 gilgamezh

+1

awwithro avatar Apr 24 '16 17:04 awwithro

+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

phateuk avatar Apr 28 '16 09:04 phateuk

:+1:

neh avatar May 27 '16 04:05 neh

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

mweirauch avatar Jun 08 '16 20:06 mweirauch

+1

arnaudmm avatar Jul 03 '16 13:07 arnaudmm

+1

rydeng avatar Jul 06 '16 12:07 rydeng

+1

vaibhavinbayarea avatar Sep 06 '16 21:09 vaibhavinbayarea

+1

alhardy avatar Sep 20 '16 08:09 alhardy

+1

erowan avatar Nov 28 '16 11:11 erowan

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

utkarshcmu avatar Dec 04 '16 10:12 utkarshcmu

+1

miketwenty1 avatar Dec 06 '16 20:12 miketwenty1

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

utkarshcmu avatar Dec 09 '16 04:12 utkarshcmu

+1

Dchamard avatar Dec 21 '16 18:12 Dchamard

+1

andrewawagner avatar Dec 22 '16 16:12 andrewawagner

+1 +1 +1 :)

ghost avatar Jan 15 '17 01:01 ghost