OK, let's start using these dashboard variables in dynamic visualizations.
The first visualization we look at is the table.
So let's create a new dashboard, so create new dashboard.
I'm going to add an empty panel.
Make it a table.
And select Prometheus, and I'm going to use what's called node, you name info, and that's the query
down there, node no, dude.
I mean, first you set query, OK, might that the larger I'm going to set that to use table and instant.
So it shows one of each.
So I'm saying to instance, address the job, which is node the node name Cox DB mice, Corcovado.
So I will create a dashboard variable that lets me choose one or more of those and there's more information
there.
OK, so apply that.
And that's our table that looks pretty good.
Let's now add the dynamic variable so we can make this table more dynamic.
So Dashboard Settings variables at variable was going to call it host.
The global Prometheus, the query label values node, you name info, job node, node name.
There's my three servers that I have node exporters running on, and they all have their job named as
node so uptight that go back to the dashboard.
We now have that, but if I change that, it doesn't really update anything.
So let's change this panel here.
Or modify this query to be explicitly job equals node, but also node name down there equals it can
be one of those site in flux DB, and it should be one that I want to use this variable here.
So instead, I could say dollar post now that will use the variable up here.
So what changed that to Moscow?
This information changes or Bafana information changes to node name Raphinha Moscow in flux DB.
OK, we can also make this a multi select option.
So let's just apply that go into dashboard settings variables.
The variable and select multi value update that go back out there, that's now multi select.
But if you use it showing no data, let's edit.
The table we need to do is convert this to a rejects filter so that tilts just there and networks based
so I can have all three selected or none or just one.
Very good.
So that's the query that creates that table.
So apply that to the go.
Select all that's done.
Now this table is quite wide.
A lot of information.
I'm going to add a transform to get rid of the unnecessary columns.
So go back into that.
Press a press transform here.
Scroll down to organize fields.
I can hide name to my name and also hard job and also value at the end.
So apply that then that table now fits.
The screening we put on Excellent.
Now we can use this dynamic table to draw the tables slightly differently as well to draw a new table
on the screen for every everyone that is selected.
So let's do that.
I'm pressing a down the bottom right here on the panel options.
We have one called repeat options.
So select host.
It's finding the dashboard variable up there.
Think of it as an option for me.
So most and the repeat direction on a horizontal, which is sideways or vertical up and down, so select
a vertical.
Now press apply.
Now if we just do select everything.
Now select a single one.
Enter.
Now select a second one.
It's created a new table down there, so we don't actually need those to be so big anymore.
And final and third row now.
Now we can also dynamically update the panel title.
So if I go into this first one, I can just delete that and say Dot host, and it's now telling me the
name of the one that is selected here.
I have three selected, but it's like showing the first one.
But if I go out, apply that and then just stick to everything and then select one.
Now, says Moscow, if I select a second, Bafana says Bafana and in flux Digby starts using dashboard
variables.
I've shown you two different ways of doing that.
It's up to you what you prefer anyway.
Excellent.