WEBVTT

00:00.150 --> 00:04.200
OK, let's start using these dashboard variables in dynamic visualizations.

00:04.230 --> 00:06.570
The first visualization we look at is the table.

00:06.840 --> 00:09.820
So let's create a new dashboard, so create new dashboard.

00:09.870 --> 00:11.070
I'm going to add an empty panel.

00:11.850 --> 00:12.780
Make it a table.

00:13.660 --> 00:23.680
And select Prometheus, and I'm going to use what's called node, you name info, and that's the query

00:23.680 --> 00:24.610
down there, node no, dude.

00:24.650 --> 00:32.290
I mean, first you set query, OK, might that the larger I'm going to set that to use table and instant.

00:32.350 --> 00:33.940
So it shows one of each.

00:34.810 --> 00:43.370
So I'm saying to instance, address the job, which is node the node name Cox DB mice, Corcovado.

00:43.810 --> 00:50.530
So I will create a dashboard variable that lets me choose one or more of those and there's more information

00:50.530 --> 00:50.770
there.

00:51.080 --> 00:52.560
OK, so apply that.

00:52.570 --> 00:55.390
And that's our table that looks pretty good.

00:55.420 --> 00:59.440
Let's now add the dynamic variable so we can make this table more dynamic.

01:00.040 --> 01:04.750
So Dashboard Settings variables at variable was going to call it host.

01:06.170 --> 01:12.750
The global Prometheus, the query label values node, you name info, job node, node name.

01:13.190 --> 01:18.950
There's my three servers that I have node exporters running on, and they all have their job named as

01:18.950 --> 01:23.010
node so uptight that go back to the dashboard.

01:23.030 --> 01:26.580
We now have that, but if I change that, it doesn't really update anything.

01:26.600 --> 01:27.930
So let's change this panel here.

01:28.670 --> 01:38.060
Or modify this query to be explicitly job equals node, but also node name down there equals it can

01:38.060 --> 01:44.360
be one of those site in flux DB, and it should be one that I want to use this variable here.

01:44.630 --> 01:50.870
So instead, I could say dollar post now that will use the variable up here.

01:50.900 --> 01:52.370
So what changed that to Moscow?

01:52.400 --> 02:00.050
This information changes or Bafana information changes to node name Raphinha Moscow in flux DB.

02:00.290 --> 02:04.610
OK, we can also make this a multi select option.

02:04.610 --> 02:08.930
So let's just apply that go into dashboard settings variables.

02:09.350 --> 02:15.770
The variable and select multi value update that go back out there, that's now multi select.

02:15.890 --> 02:18.650
But if you use it showing no data, let's edit.

02:18.650 --> 02:27.840
The table we need to do is convert this to a rejects filter so that tilts just there and networks based

02:27.860 --> 02:32.750
so I can have all three selected or none or just one.

02:33.080 --> 02:33.560
Very good.

02:34.310 --> 02:36.800
So that's the query that creates that table.

02:36.890 --> 02:39.050
So apply that to the go.

02:39.050 --> 02:41.000
Select all that's done.

02:41.090 --> 02:42.650
Now this table is quite wide.

02:42.860 --> 02:43.700
A lot of information.

02:43.730 --> 02:47.250
I'm going to add a transform to get rid of the unnecessary columns.

02:47.270 --> 02:48.380
So go back into that.

02:48.380 --> 02:50.840
Press a press transform here.

02:52.550 --> 02:55.910
Scroll down to organize fields.

02:56.330 --> 03:03.920
I can hide name to my name and also hard job and also value at the end.

03:04.730 --> 03:08.120
So apply that then that table now fits.

03:09.320 --> 03:11.090
The screening we put on Excellent.

03:12.130 --> 03:17.110
Now we can use this dynamic table to draw the tables slightly differently as well to draw a new table

03:17.110 --> 03:19.240
on the screen for every everyone that is selected.

03:19.250 --> 03:20.400
So let's do that.

03:20.460 --> 03:25.340
I'm pressing a down the bottom right here on the panel options.

03:25.390 --> 03:27.670
We have one called repeat options.

03:27.760 --> 03:29.230
So select host.

03:29.410 --> 03:32.080
It's finding the dashboard variable up there.

03:32.140 --> 03:33.670
Think of it as an option for me.

03:33.680 --> 03:40.440
So most and the repeat direction on a horizontal, which is sideways or vertical up and down, so select

03:40.450 --> 03:41.020
a vertical.

03:41.650 --> 03:43.660
Now press apply.

03:44.020 --> 03:47.080
Now if we just do select everything.

03:47.380 --> 03:49.120
Now select a single one.

03:49.210 --> 03:49.780
Enter.

03:49.900 --> 03:51.640
Now select a second one.

03:51.910 --> 03:57.310
It's created a new table down there, so we don't actually need those to be so big anymore.

03:57.910 --> 04:00.610
And final and third row now.

04:00.760 --> 04:03.750
Now we can also dynamically update the panel title.

04:03.760 --> 04:12.520
So if I go into this first one, I can just delete that and say Dot host, and it's now telling me the

04:12.520 --> 04:15.400
name of the one that is selected here.

04:15.400 --> 04:17.770
I have three selected, but it's like showing the first one.

04:17.770 --> 04:24.010
But if I go out, apply that and then just stick to everything and then select one.

04:24.130 --> 04:31.180
Now, says Moscow, if I select a second, Bafana says Bafana and in flux Digby starts using dashboard

04:31.180 --> 04:31.750
variables.

04:31.840 --> 04:33.480
I've shown you two different ways of doing that.

04:33.490 --> 04:35.200
It's up to you what you prefer anyway.

04:35.320 --> 04:35.740
Excellent.
