OK, so now we will start looking at the Prometheus data source.
And for that, we'll need to install Prometheus service.
I'm going to install that on my existing Safana server.
You can install it on another server if you like.
But just to keep it simple, I'll use the Koran system.
OK, so S.H. onto your Safana server, OK, and you can run sudo apt to install Prometheus.
It's much simpler to install and prob tale because the information exists in the APT cache already.
So enter.
Yes.
A case that's already set up a Prometheus service for us, or we can check that sudo service Prometheus
status.
And it's already running, we didn't need to stop that.
And if I just press right, we can see some of the latest logs.
OK, let's look at the diagram.
What that has done that IP to install Prometheus has set up Prometheus of his force, plus also a node
exporter.
It has also created a user called Prometheus, so we can expect those indeed Prometheus.
It's created a user called Prometheus with a signed group, Prometheus.
We can see what processes that user is running by running piece by Finn, you Prometheus.
And it's running two processes one called Prometheus and one called Prometheus A..
We can also see which ports those processes have opened up.
So on a Bourne 220, we can use a program called SS.
It's very similar to netstat.
We've used it in L2TP grep, Prometheus and we go and it's telling me the Prometheus node is using nine
100 and Prometheus is using 1990.
Its word wrapped.
So it's quite hard to see that is actually one line been word wrapped there.
Now, in the last video, I set up a firewall using my clip of auto digital ocean.
I'm no longer going to use IP tables to manage firewall rules.
I'm going to use the firewall using the digital ocean UI, since it's much easier and your cloud provider
will have something similar.
Now, if I look at the rules that I created for Microphone Server, I named my rogue refiner as well.
I have these ports open, so I don't need to block Port 1990 or 9-1-1.
They are already blocked.
If I wanted to, I could open up another port for 1990 and allow all IP addresses if I wanted to.
But I'm not going to do that.
I'm going to leave it restricted so it can only be called internally using microphone.
So if you want to see whether the high CTP endpoint of Prometheus is running, you can type Curl CTP
127 zero zero two one call in 1990.
And so it's returned a hasty email response, saying found if you wanted to look at something more complicated,
you could type slash metrics and then we go.
These are all the metrics that are being returned from the Prometheus endpoint.
This is the same case for Port nine 100 metrics.
There are metrics being returned from the not exporter as well.
Looking at both of these services running, both of them have a metrics endpoint.
They can call on both those ports that were returned values.
Now, as you can see, setting up the Prometheus service with its own collector, which is the node
exporter, is currently much simpler than setting up blokey with a prompter service.
Now, both of them have their own query language Prometheus.
This is from Cairo, and Loki uses local.
Also tell the difference between the two.
Prometheus is about numbers and values, whereas Loki is about reading log falls where they contain
strings.
Also, the prompt for service is pushing data to the Loki service, whereas Prometheus is requesting
data from the node exporter.
So you can see that's the direction of the arrow that I've drawn.
So there's some main differences there.
Now we can say that all that is running, we can connect to that grandfather by setting up a Prometheus
data source.
So let's do that now.
Agraféna, Okay, I've logged onto mega-fauna.
You are data sources.
Add data source Prometheus, which is one of the top select OK HTP Local Hosts 1990, or you could type
CTP one three seven zero zero one call on.
It's the same save and test and data sources are working.
Excellent data source is updated.
We go into the Explore tab.
Prometheus now exists as an option.
We can select that now Prometheus has its own Matrix browser.
There is a whole lot of information.
Prometheus is quite a sophisticated monitoring tool, and you can set up not explorers on many servers,
all pointing to a Prometheus server, and we can read that through Bafana.
OK, so looking at the many options here, some of them start with note and others start with Prometheus.
The one segment Prometheus is query a coming from the Prometheus service, whereas the ones starting
with node the TCP in, for example, instance 9100 use query are coming from the node exporter process.
Normally, you would be reading Prometheus stats from the node exporters set up Note Explorer on another
server later.
But if you want to know information about the actual Prometheus service, you can also query that as
well.
Anyway, I recommend looking at the Matrix browser, going through a lot of those and seeing what they
do, but we'll install a proper dashboard for Prometheus next video, which will make a lot of that
much easier for us because there's just a lot to choose from there.
So, but one good one to check now is up just this simple wood up and look up for both 1990 and nine
100 use query, and we can see that that is returned from both of the metrics and Points 1999 describing
the job and value one, which is the same as saying true.
So both of those services are up and the graph is going to be quite simple, but you can see that's
prompt.
Know it's very similar to local, it is different, but you create in much the same way.
OK, so excellent.