1
00:00:00,120 --> 00:00:04,230
OK, so now we will start looking at the Prometheus data source.

2
00:00:04,320 --> 00:00:07,470
And for that, we'll need to install Prometheus service.

3
00:00:07,500 --> 00:00:10,590
I'm going to install that on my existing Safana server.

4
00:00:10,680 --> 00:00:12,500
You can install it on another server if you like.

5
00:00:12,520 --> 00:00:15,090
But just to keep it simple, I'll use the Koran system.

6
00:00:15,210 --> 00:00:23,440
OK, so S.H. onto your Safana server, OK, and you can run sudo apt to install Prometheus.

7
00:00:23,460 --> 00:00:28,370
It's much simpler to install and prob tale because the information exists in the APT cache already.

8
00:00:28,380 --> 00:00:29,070
So enter.

9
00:00:29,760 --> 00:00:30,210
Yes.

10
00:00:33,110 --> 00:00:41,180
A case that's already set up a Prometheus service for us, or we can check that sudo service Prometheus

11
00:00:41,270 --> 00:00:42,340
status.

12
00:00:42,860 --> 00:00:45,300
And it's already running, we didn't need to stop that.

13
00:00:45,330 --> 00:00:49,190
And if I just press right, we can see some of the latest logs.

14
00:00:49,220 --> 00:00:50,390
OK, let's look at the diagram.

15
00:00:50,420 --> 00:00:56,600
What that has done that IP to install Prometheus has set up Prometheus of his force, plus also a node

16
00:00:56,600 --> 00:00:57,140
exporter.

17
00:00:57,170 --> 00:01:03,590
It has also created a user called Prometheus, so we can expect those indeed Prometheus.

18
00:01:04,069 --> 00:01:07,350
It's created a user called Prometheus with a signed group, Prometheus.

19
00:01:07,370 --> 00:01:13,760
We can see what processes that user is running by running piece by Finn, you Prometheus.

20
00:01:13,910 --> 00:01:18,020
And it's running two processes one called Prometheus and one called Prometheus A..

21
00:01:18,110 --> 00:01:21,740
We can also see which ports those processes have opened up.

22
00:01:21,890 --> 00:01:24,800
So on a Bourne 220, we can use a program called SS.

23
00:01:24,920 --> 00:01:26,390
It's very similar to netstat.

24
00:01:26,520 --> 00: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

25
00:01:35,000 --> 00:01:38,750
100 and Prometheus is using 1990.

26
00:01:38,750 --> 00:01:39,560
Its word wrapped.

27
00:01:39,560 --> 00:01:43,940
So it's quite hard to see that is actually one line been word wrapped there.

28
00:01:43,970 --> 00:01:48,920
Now, in the last video, I set up a firewall using my clip of auto digital ocean.

29
00:01:48,980 --> 00:01:52,680
I'm no longer going to use IP tables to manage firewall rules.

30
00:01:52,700 --> 00:01:58,010
I'm going to use the firewall using the digital ocean UI, since it's much easier and your cloud provider

31
00:01:58,010 --> 00:01:59,060
will have something similar.

32
00:01:59,120 --> 00:02:04,670
Now, if I look at the rules that I created for Microphone Server, I named my rogue refiner as well.

33
00:02:04,700 --> 00:02:08,940
I have these ports open, so I don't need to block Port 1990 or 9-1-1.

34
00:02:09,240 --> 00:02:10,160
They are already blocked.

35
00:02:10,280 --> 00:02:15,890
If I wanted to, I could open up another port for 1990 and allow all IP addresses if I wanted to.

36
00:02:15,890 --> 00:02:16,710
But I'm not going to do that.

37
00:02:16,730 --> 00:02:21,330
I'm going to leave it restricted so it can only be called internally using microphone.

38
00:02:21,360 --> 00:02:27,740
So if you want to see whether the high CTP endpoint of Prometheus is running, you can type Curl CTP

39
00:02:27,740 --> 00:02:31,700
127 zero zero two one call in 1990.

40
00:02:31,710 --> 00:02:37,070
And so it's returned a hasty email response, saying found if you wanted to look at something more complicated,

41
00:02:37,070 --> 00:02:39,650
you could type slash metrics and then we go.

42
00:02:39,680 --> 00:02:43,910
These are all the metrics that are being returned from the Prometheus endpoint.

43
00:02:43,940 --> 00:02:47,880
This is the same case for Port nine 100 metrics.

44
00:02:47,990 --> 00:02:50,450
There are metrics being returned from the not exporter as well.

45
00:02:50,810 --> 00:02:54,320
Looking at both of these services running, both of them have a metrics endpoint.

46
00:02:54,320 --> 00:02:57,470
They can call on both those ports that were returned values.

47
00:02:57,500 --> 00:03:02,240
Now, as you can see, setting up the Prometheus service with its own collector, which is the node

48
00:03:02,240 --> 00:03:06,360
exporter, is currently much simpler than setting up blokey with a prompter service.

49
00:03:06,380 --> 00:03:09,100
Now, both of them have their own query language Prometheus.

50
00:03:09,100 --> 00:03:11,470
This is from Cairo, and Loki uses local.

51
00:03:11,480 --> 00:03:13,240
Also tell the difference between the two.

52
00:03:13,250 --> 00:03:19,520
Prometheus is about numbers and values, whereas Loki is about reading log falls where they contain

53
00:03:19,530 --> 00:03:20,090
strings.

54
00:03:20,120 --> 00:03:26,420
Also, the prompt for service is pushing data to the Loki service, whereas Prometheus is requesting

55
00:03:26,420 --> 00:03:28,250
data from the node exporter.

56
00:03:28,250 --> 00:03:30,920
So you can see that's the direction of the arrow that I've drawn.

57
00:03:31,040 --> 00:03:32,610
So there's some main differences there.

58
00:03:32,630 --> 00:03:36,560
Now we can say that all that is running, we can connect to that grandfather by setting up a Prometheus

59
00:03:36,560 --> 00:03:37,100
data source.

60
00:03:37,100 --> 00:03:37,930
So let's do that now.

61
00:03:37,940 --> 00:03:40,220
Agraféna, Okay, I've logged onto mega-fauna.

62
00:03:40,220 --> 00:03:42,200
You are data sources.

63
00:03:42,200 --> 00:03:49,820
Add data source Prometheus, which is one of the top select OK HTP Local Hosts 1990, or you could type

64
00:03:50,000 --> 00:03:53,330
CTP one three seven zero zero one call on.

65
00:03:53,900 --> 00:03:57,730
It's the same save and test and data sources are working.

66
00:03:57,740 --> 00:03:59,480
Excellent data source is updated.

67
00:03:59,720 --> 00:04:01,760
We go into the Explore tab.

68
00:04:02,300 --> 00:04:04,520
Prometheus now exists as an option.

69
00:04:04,520 --> 00:04:07,760
We can select that now Prometheus has its own Matrix browser.

70
00:04:08,270 --> 00:04:09,980
There is a whole lot of information.

71
00:04:10,250 --> 00:04:15,470
Prometheus is quite a sophisticated monitoring tool, and you can set up not explorers on many servers,

72
00:04:15,500 --> 00:04:20,000
all pointing to a Prometheus server, and we can read that through Bafana.

73
00:04:20,029 --> 00:04:26,480
OK, so looking at the many options here, some of them start with note and others start with Prometheus.

74
00:04:26,480 --> 00:04:33,530
The one segment Prometheus is query a coming from the Prometheus service, whereas the ones starting

75
00:04:33,530 --> 00:04:42,100
with node the TCP in, for example, instance 9100 use query are coming from the node exporter process.

76
00:04:42,110 --> 00:04:48,230
Normally, you would be reading Prometheus stats from the node exporters set up Note Explorer on another

77
00:04:48,230 --> 00:04:49,100
server later.

78
00:04:49,340 --> 00:04:54,290
But if you want to know information about the actual Prometheus service, you can also query that as

79
00:04:54,290 --> 00:04:54,560
well.

80
00:04:54,590 --> 00:04:59,600
Anyway, I recommend looking at the Matrix browser, going through a lot of those and seeing what they

81
00:04:59,600 --> 00:05:04,340
do, but we'll install a proper dashboard for Prometheus next video, which will make a lot of that

82
00:05:04,340 --> 00:05:07,240
much easier for us because there's just a lot to choose from there.

83
00:05:07,250 --> 00: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

84
00:05:15,930 --> 00:05:24,110
100 use query, and we can see that that is returned from both of the metrics and Points 1999 describing

85
00:05:24,110 --> 00:05:27,500
the job and value one, which is the same as saying true.

86
00:05:27,530 --> 00: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

87
00:05:32,030 --> 00:05:32,420
prompt.

88
00:05:32,650 --> 00:05:37,330
Know it's very similar to local, it is different, but you create in much the same way.

89
00:05:37,360 --> 00:05:38,230
OK, so excellent.

