Possible to have dynamic template variables?

Hi all. Consider the following:

Where the tags in the top left are defined as follows:

What I am curious about is, is there a way to dynamically show ALL tags in the top left of the screen for a given measurement? This is what I have in mind; I just don’t know if it’s even possible to do:

This way, as data gets collected it can get “tagged” by a user specifying their own tag. I know this could bring many problems but I am curious if this is possible.

Still seeking an answer on this.

Still wondering if this is possible.

Try:

SHOW TAG VALUES WITH KEY =~ /.*/

I think what you’re after is “Ad hoc filters” - available under variable type when creating the template variable. Check https://github.com/grafana/grafana/issues/6038 for a bit of a demo

Yup that is what I am looking for… Anyway I can set there to be a dynamic number of adhoc filters on the screen? I want the user to be able to select tags (and as many of them) as they wish.

Yes, adding an ad hoc filter allows filtering against multiple tags at once. Probably best to just try it out - it’s fairly intuitive.

I tried it out. This is what I am looking for:

But upon the user adding a tag via the adhoc, another adhoc gets added:

adhoc2

Is this possible with out having to add n amount of adhocs manually?

Hm I’m not sure how the behavior that you describe is coming about.

This is what I see after (1) adding an Ad Hoc variable called “adhoc”, (2) clicking on “+” to add a filter, (3) setting the tag name to “asset_id”, (4) selecting an ID from the drop-down:


Obviously both the “asset_id” tag and the UUID are specific to my dataset, but you get the idea.

If, as you describe, you are actually seeing another variable (adhoc2) being added automatically - i.e. you did not add it yourself - then that sounds like a bug, which ought to be reported at Issues · grafana/grafana · GitHub