WEBVTT

00:00.120 --> 00:04.230
OK, so now we will start looking at the Prometheus data source.

00:04.320 --> 00:07.470
And for that, we'll need to install Prometheus service.

00:07.500 --> 00:10.590
I'm going to install that on my existing Safana server.

00:10.680 --> 00:12.500
You can install it on another server if you like.

00:12.520 --> 00:15.090
But just to keep it simple, I'll use the Koran system.

00:15.210 --> 00:23.440
OK, so S.H. onto your Safana server, OK, and you can run sudo apt to install Prometheus.

00:23.460 --> 00:28.370
It's much simpler to install and prob tale because the information exists in the APT cache already.

00:28.380 --> 00:29.070
So enter.

00:29.760 --> 00:30.210
Yes.

00:33.110 --> 00:41.180
A case that's already set up a Prometheus service for us, or we can check that sudo service Prometheus

00:41.270 --> 00:42.340
status.

00:42.860 --> 00:45.300
And it's already running, we didn't need to stop that.

00:45.330 --> 00:49.190
And if I just press right, we can see some of the latest logs.

00:49.220 --> 00:50.390
OK, let's look at the diagram.

00:50.420 --> 00:56.600
What that has done that IP to install Prometheus has set up Prometheus of his force, plus also a node

00:56.600 --> 00:57.140
exporter.

00:57.170 --> 01:03.590
It has also created a user called Prometheus, so we can expect those indeed Prometheus.

01:04.070 --> 01:07.350
It's created a user called Prometheus with a signed group, Prometheus.

01:07.370 --> 01:13.760
We can see what processes that user is running by running piece by Finn, you Prometheus.

01:13.910 --> 01:18.020
And it's running two processes one called Prometheus and one called Prometheus A..

01:18.110 --> 01:21.740
We can also see which ports those processes have opened up.

01:21.890 --> 01:24.800
So on a Bourne 220, we can use a program called SS.

01:24.920 --> 01:26.390
It's very similar to netstat.

01:26.520 --> 01:35.000
We've used it in L2TP grep, Prometheus and we go and it's telling me the Prometheus node is using nine

01:35.000 --> 01:38.750
100 and Prometheus is using 1990.

01:38.750 --> 01:39.560
Its word wrapped.

01:39.560 --> 01:43.940
So it's quite hard to see that is actually one line been word wrapped there.

01:43.970 --> 01:48.920
Now, in the last video, I set up a firewall using my clip of auto digital ocean.

01:48.980 --> 01:52.680
I'm no longer going to use IP tables to manage firewall rules.

01:52.700 --> 01:58.010
I'm going to use the firewall using the digital ocean UI, since it's much easier and your cloud provider

01:58.010 --> 01:59.060
will have something similar.

01:59.120 --> 02:04.670
Now, if I look at the rules that I created for Microphone Server, I named my rogue refiner as well.

02:04.700 --> 02:08.940
I have these ports open, so I don't need to block Port 1990 or 9-1-1.

02:09.240 --> 02:10.160
They are already blocked.

02:10.280 --> 02:15.890
If I wanted to, I could open up another port for 1990 and allow all IP addresses if I wanted to.

02:15.890 --> 02:16.710
But I'm not going to do that.

02:16.730 --> 02:21.330
I'm going to leave it restricted so it can only be called internally using microphone.

02:21.360 --> 02:27.740
So if you want to see whether the high CTP endpoint of Prometheus is running, you can type Curl CTP

02:27.740 --> 02:31.700
127 zero zero two one call in 1990.

02:31.710 --> 02:37.070
And so it's returned a hasty email response, saying found if you wanted to look at something more complicated,

02:37.070 --> 02:39.650
you could type slash metrics and then we go.

02:39.680 --> 02:43.910
These are all the metrics that are being returned from the Prometheus endpoint.

02:43.940 --> 02:47.880
This is the same case for Port nine 100 metrics.

02:47.990 --> 02:50.450
There are metrics being returned from the not exporter as well.

02:50.810 --> 02:54.320
Looking at both of these services running, both of them have a metrics endpoint.

02:54.320 --> 02:57.470
They can call on both those ports that were returned values.

02:57.500 --> 03:02.240
Now, as you can see, setting up the Prometheus service with its own collector, which is the node

03:02.240 --> 03:06.360
exporter, is currently much simpler than setting up blokey with a prompter service.

03:06.380 --> 03:09.100
Now, both of them have their own query language Prometheus.

03:09.100 --> 03:11.470
This is from Cairo, and Loki uses local.

03:11.480 --> 03:13.240
Also tell the difference between the two.

03:13.250 --> 03:19.520
Prometheus is about numbers and values, whereas Loki is about reading log falls where they contain

03:19.530 --> 03:20.090
strings.

03:20.120 --> 03:26.420
Also, the prompt for service is pushing data to the Loki service, whereas Prometheus is requesting

03:26.420 --> 03:28.250
data from the node exporter.

03:28.250 --> 03:30.920
So you can see that's the direction of the arrow that I've drawn.

03:31.040 --> 03:32.610
So there's some main differences there.

03:32.630 --> 03:36.560
Now we can say that all that is running, we can connect to that grandfather by setting up a Prometheus

03:36.560 --> 03:37.100
data source.

03:37.100 --> 03:37.930
So let's do that now.

03:37.940 --> 03:40.220
Agraféna, Okay, I've logged onto mega-fauna.

03:40.220 --> 03:42.200
You are data sources.

03:42.200 --> 03:49.820
Add data source Prometheus, which is one of the top select OK HTP Local Hosts 1990, or you could type

03:50.000 --> 03:53.330
CTP one three seven zero zero one call on.

03:53.900 --> 03:57.730
It's the same save and test and data sources are working.

03:57.740 --> 03:59.480
Excellent data source is updated.

03:59.720 --> 04:01.760
We go into the Explore tab.

04:02.300 --> 04:04.520
Prometheus now exists as an option.

04:04.520 --> 04:07.760
We can select that now Prometheus has its own Matrix browser.

04:08.270 --> 04:09.980
There is a whole lot of information.

04:10.250 --> 04:15.470
Prometheus is quite a sophisticated monitoring tool, and you can set up not explorers on many servers,

04:15.500 --> 04:20.000
all pointing to a Prometheus server, and we can read that through Bafana.

04:20.030 --> 04:26.480
OK, so looking at the many options here, some of them start with note and others start with Prometheus.

04:26.480 --> 04:33.530
The one segment Prometheus is query a coming from the Prometheus service, whereas the ones starting

04:33.530 --> 04:42.100
with node the TCP in, for example, instance 9100 use query are coming from the node exporter process.

04:42.110 --> 04:48.230
Normally, you would be reading Prometheus stats from the node exporters set up Note Explorer on another

04:48.230 --> 04:49.100
server later.

04:49.340 --> 04:54.290
But if you want to know information about the actual Prometheus service, you can also query that as

04:54.290 --> 04:54.560
well.

04:54.590 --> 04:59.600
Anyway, I recommend looking at the Matrix browser, going through a lot of those and seeing what they

04:59.600 --> 05:04.340
do, but we'll install a proper dashboard for Prometheus next video, which will make a lot of that

05:04.340 --> 05:07.240
much easier for us because there's just a lot to choose from there.

05:07.250 --> 05:15.920
So, but one good one to check now is up just this simple wood up and look up for both 1990 and nine

05:15.930 --> 05:24.110
100 use query, and we can see that that is returned from both of the metrics and Points 1999 describing

05:24.110 --> 05:27.500
the job and value one, which is the same as saying true.

05:27.530 --> 05:32.030
So both of those services are up and the graph is going to be quite simple, but you can see that's

05:32.030 --> 05:32.420
prompt.

05:32.650 --> 05:37.330
Know it's very similar to local, it is different, but you create in much the same way.

05:37.360 --> 05:38.230
OK, so excellent.
