
01 Monitoring Jenkins using Prometheus and Grafana #nepal #nepaltech #devops #SRE
01 Monitoring Jenkins using Prometheus and Grafana #nepal #nepaltech #devops #SRE
This Video Gives brief about Jenkins, Grafana and Prometheus and a demo on integrating all these tools.
- created a clean ubuntu server.
- installed jenkins
- installed docker
- ran prometheus and grafana inside the docker container and monitoring was done.
Content
1.02 -> hello everyone welcome to Nepal Tech so today
I have brought a video regarding monitoring
5.88 -> so today we'll be monitoring zenkins server
using Prometheus and grafana so these three
10.5 -> are basically the devops tool so talking about
zenkins it is a continuous integration and
15.18 -> continuous deployment tool so we'll be learning
more in this video as well and talking about
22.32 -> Prometheus it is a Time series database that
collects and stores data and talking about
26.88 -> graph Hana it is a visual and analytics platform
so using the data we can visualize our data and
33.48 -> um get some resourceful
information from that data so
37.68 -> regarding the Jenkins installation I have already
made a video and uh I have uploaded on my YouTube
42.18 -> channel so you can take it there as well so
let's go to my server and I'll be installing the
48.42 -> Jenkins once again so if you have not checked
out my video previous video you can check it
53.1 -> right here as well so previously I was using g2s
for my SSS connection for now I'll be using my
58.14 -> terminal here so let me access into my server
so my server IPs one for sorry 159.138.93.130
74.22 -> oh sorry 148 there's a type here and
looks like there is already a key edit
81.18 -> on this so let me go and remove this now
and we'll be logging into the server so
88.2 -> okay so it is not recognized here so let
me do one thing let me go to gateways
94.02 -> and since gitbase is powerful it has multiple
features which is not allowed by the terminal
98.76 -> here so let me go to gateways and let
me do Dano let me remove the entries
104.1 -> with this IP address let me save this and let
me go back here once again and let me run the
112.62 -> SS login command once again and here
you might see the prompt has been
120.36 -> okay let me enter my password
127.98 -> okay looks like I mistyped my password so looks
like we are fine now let's start working around
135.96 -> this server so at first uh let's check if
there is Java install or not so to check
139.98 -> the Java later there is a command Java
version so here we can see there is not
147.48 -> Java installed so it is saying command Java not
found what it can be installed using this command
151.68 -> so we have a sets of command here so I'll be
running these commands here so I have already
157.08 -> updated the system so I'll skip the command there
and let me paste this so it will download the
165.3 -> jdk of personnet and if you
want the version of 11 you can
169.2 -> download it accordingly so this will be for uh
open zdk 11 and this will be for open jdk8 so
175.5 -> looks like there is something missing let
me try it with my open jdk with version 11.
187.62 -> okay name server 8.8.8 slash Etc LV
Dot comf okay let's try it once again
201.36 -> this works perfectly fine or
206.76 -> oven to open jdk let me go to my ATC slash
result Dot conf okay let me get to it
216.72 -> and name server I added the Google as
the name server but still it's showing uh
223.92 -> okay it's not working at first let me
update the system so a PT update I guess
229.8 -> I had updated the system but let's
check this might take a bit of time
241.08 -> okay so let me rerun the command
once again this time it might work
248.76 -> foreign
250.74 -> but I as you can see I ran the command
with jdk version 11 so my jdk will be
263.82 -> of course on 11 and let's go ahead and copy
the next command till then let's see here if
269.94 -> it's working fine so this
might take a bit of time so
279.36 -> so and as I mentioned earlier I'll be using graph
Anna and Prometheus for uh monitoring the Jenkins
287.16 -> server so for this what I'll need is I'll be
creating two container one with permission one
291.84 -> for Prometheus and another for grafana and as
you know this is a Docker up and Docker Hub is
297.6 -> the registry for Docker we can also have other
registries as well so as for now this is the
303.96 -> official registry for Docker for Docker images
so I'll go here and here you can see there is a
309.6 -> container there is a Docker image here with
the name from Prometheus so this is the
315.48 -> image that I'll be pulling for the Prometheus
and this is the image that I'll be pulling for
320.28 -> the graph Anna and here you can see this is from
verified publisher by graph analapse and this
325.2 -> is not this does not Source verified problems are
here but this image works perfectly fine regarding
330.96 -> the Prometheus so let me go back and let me check
it's still taking some time so here you can see
339.36 -> basically how it works so here we can see how it's
collect the data so basically what uh Prometheus
344.82 -> does is it collects the real time data's and here
we can see these are the many things that we use
353.28 -> with the Prometheus here you can see there is
a graphana and so this graphana is used for
358.74 -> visualization purpose regarding the data that is
collected by Pontius and using this container uh
364.74 -> and we must be clear that the Prometheus and
grafana uses specific ports so for Prometheus
371.1 -> there is a specified Port that is 90 90 or 9090
and talking about graph Anna there is a specified
376.98 -> Port that is 3000 and it must be mapped with 3000
so this is my washed machine IP uh port and this
384.06 -> is my container Port so basically that's the thing
I think this might have been completed it still is
390.54 -> on the way of completion so till then let's
see so these are the multiple versions that are
395.52 -> officially available here
399.66 -> so this refers to the process of versioning
and based on the releases these are version
404.16 -> here so if we want to work on specified version
we can specify here as well so what we can do is
410.58 -> we can place here Docker tool graph Anna call on
colon and we can specify the version name that is
416.7 -> 4.8 point sorry person eight point zero point
eight point three point zero beta 2 or 8.2.6
424.5 -> accordingly and will be downloading the image
accordingly here so okay looks like my internet is
436.8 -> causing some issue and let's see here and if you
want to create a Custom Image and add something
442.44 -> on this so for this we can also do from from
Prometheus add Prometheus dot EML inside the
448.32 -> ETC Prometheus so this is the main file that
we'll be using so we must specify the source
453.96 -> from which our parameters will be collecting
the data so this is done inside the Prometheus
460.08 -> dot yml so I'll be creating a container and I'll
be going to I'll be changing the prometheus.aml
466.62 -> by content execute by uh executing inside the
container so I'll not be writing this Docker
473.64 -> file as of now so this will be the best practice
as well so but we'll be doing some changes in from
479.1 -> thes.aml inside the ETC Prometheus so that's
the thing basically and let's see so it's look
489.72 -> like it's been doing 72 percentage so till then
let's wait let me copy another sets of command
496.14 -> okay so this was the command I already copied and
here we can see and let's see the definition here
505.62 -> and uh so for promises it is designed to be
scalable and reliable and provide real-time
510.48 -> visibility into the operation of complex system
so what we can see is we can see the systems and
517.02 -> see their operations how the complex systems
are working and all and so this is basically
522.54 -> done using the data that are provided
from the complex system and we used them
527.22 -> in the graph Anna for visualization purpose and
talking about graphene it provides us dashboard
533.16 -> and we can add panels to it so there are multiple
types of panel it can it might be bar graph it
538.8 -> might because it might be time series so there
are multiple displays choosing options as well and
546.48 -> we can choose multiple source to it so as for now
we'll be selecting the data sources Prometheus
551.28 -> and it will allow our user to create a customized
graphical representation so we can customize the
556.44 -> dashboard as per our need and as per the data that
we want to interact to and we want to explore too
562.44 -> so this is basically the thing and for running
this uh Prometheus and graph and a container
567.06 -> I'll be requiring Docker as well so for that
I'll be installing the docker using this command
572.82 -> so pretty much these are the so
these four are the devops tool so
577.5 -> the first one is Jenkins it's a tool for
continuous integration and deployment and
583.14 -> Prometheus is for monitoring for crawling
the data and graphene is for displaying the
589.2 -> visualization or and the analytics and Docker
is for packaging our containerized workload
595.14 -> so I'll not be talking much further regarding
the specified specific case but yeah basically
601.8 -> we'll be talking about it and talking about
Docker I'll be creating a different video and
605.76 -> I'll be publishing here so please wait until the
next video for Docker session so looks like our
615 -> installation process is successful
so let me go here and let me
619.8 -> okay let me copy it and let me
paste here so after pasting Okay so
632.76 -> once a minute looks like I paste it multiple
times so it might not work so at First Let Me
640.02 -> Clear My screen terminal screen and let's start by
the same command and let me hit enter let me run
647.1 -> another command and this starts and ends from here
to here let me paste it let me update the system
658.38 -> okay the systems is getting outdated
so let me install design games now
664.68 -> so let me install zenkins here and
let me check the status of Jenkins
682.26 -> okay after the successful
installation we can see our
686.76 -> Jenkins dashboard here so as for now the
Jenkins is not installed and it's on 67
695.16 -> percentage so it's not showing here but after
the successful installation the dashboards of
699.06 -> Jenkins will be shown here and the port here as
you can see there I am using 8080 Port so as per
705.54 -> by default the Jenkins uses default port 8080 so
we must provide it with default port 8080 or else
711.36 -> we can also change the port so in this video I
will not be changing the port we'll be accessing
715.32 -> the Jenkins dashboard from port 8080 as well so so
let me go here and let me check it's unpacking the
723.66 -> files so let me go back here and Let
me refresh it's still not working so
730.68 -> looks like it's been downloaded
and it's working on it so
736.86 -> yeah basically let's see so what it says is we
must first unlock the Jenkins so for unlocking
742.32 -> we need to place a password here so for password
there is a initial admin password located in this
747.48 -> directory or located in this file so let me
cut to the file and let me copy the password
752.52 -> after copying the password let me paste it here
and let me run it so after running we can see
758.4 -> a setup Wizard and so this installs the default
plugins and we can also customize the logins by us
765.18 -> down by installing the selective plugin so I'll be
installing the default login as well here so after
771.78 -> clicking on the install suggested plugin it will
take some times to install the default plugin so
778.92 -> let's wait so until the status gets uh completed
let's go to the server once again let me come
787.44 -> back here let me clear the screen and now I'll be
installing the Docker and let me first check if
793.44 -> there is a Docker installed or not Docker vrsion
so here we can see command dock are not found what
799.2 -> can be installed with so let me clear the screen
and let me install the docker sudo apt install
805.32 -> dot iO iPhone y so Docker dot IO works for
812.1 -> Ubuntu distributions as well so
let's go here Ubuntu our Linux
815.58 -> distribution as well so let's swell
wait until the docker gets installed
822.84 -> foreign
825.48 -> so after successfully installing Docker I'll
be running these commands so these commands are
831.6 -> for pulling the docker images from Docker Hub so
this is the official registry here so this it is
837.48 -> similar to git clone so what we do is basically
we go to GitHub we copy the remote URL we
843.48 -> come to our local machine and we paste the
git clone and the URL so after doing that
848.52 -> the contents that were in a GitHub remote repo
will be on our local system so similarly it
854.58 -> works accordingly and let's go here let's see
so Docker might also take some time so there
861.48 -> is also a Docker pool and if we want to push
our image to Docker Hub what we can do is we
866.34 -> can we have a Docker command this is Docker pull
push sorry Docker push and we must provide our
873.54 -> repository name and the image name
so accordingly it will be pooling
878.52 -> pushing the image from our local to the
docker of registry and so basically yes
886.92 -> and here we can select see the details that's
listed here for Prometheus Prometheus is a
892.02 -> system and service monitoring system it collects
metrics from configure Target at given interval
896.34 -> evaluates rule expression displays the result
and can trigger alerts if some condition is
901.44 -> observed to be true so what we can also do is we
can also provide some expression to it and based
908.04 -> on the expression we can trigger an alerts and if
the trigger gets triggered we will be getting the
914.16 -> alert as well so there is a huge advantage
of using Prometheus and grafana together so
920.28 -> let's not jump into ease and everything on
this video I'll try to make it simple and sweet
925.86 -> so let me clear the screen Docker is installed
so Docker version gives me the client and server
931.44 -> version so the client is installed with the client
and server are installed with the same version so
937.2 -> so this basically works as a client server model
so let me clear this and so there is a command
943.92 -> so Docker images lists out the images that are
currently available in my system so after running
949.86 -> the docker images command I see no images here
since I have not downloaded or created any image
955.74 -> onto my system so it's showing me that the docker
images is not stored or there is no images here
963.18 -> and Docker PS displays the running container so
here you can see while Docker images the there
969.24 -> was a repository while uh running the dockerps
command it shows the container ID so let me first
977.1 -> create a let me first pull the Prometheus and
graph an image from Docker Hub so before that
983.82 -> uh looks like our zenkins is successfully
installed let me enter my credentials here
992.28 -> so for the first time you need
to enter your credentials here
1000.86 -> okay so let me save and continue and save
and finish so this is asking the zenkins
1007.34 -> URL so by default it will provide this
URL and I'll be using the same URL for
1012.2 -> accessing the Jenkins dashboard so here you can
see your design screen setup is complete start
1016.58 -> using the means so basically now we can start
using zenkins so at first what I'll do I'll be
1022.1 -> creating one or two jobs here but before that what
we need to do is we need to go to manage engines
1028.76 -> and inside manage zenkins sorry manage
plugins there is a plugin so for install
1034.52 -> plugin you can check it on the install plugin
and for downloading the problem we need to go
1038.78 -> to the available plugins option so let me go
here and let me download the Prometheus plugin
1044.36 -> so p r o m e t l c u s Prometheus Matrix so this
is the plugin that we'll be needing so what I'll
1050.78 -> do I'll be doing install without restart
so looks like it's installed successfully
1057.8 -> and so let's wait until let's get done so here
we can see Prometheus Matrix and it shows the
1063.02 -> error option so let's read it out from this
plugin doesn't support Dynamic loading Jenkins
1067.4 -> needs to be restarted for the update to take
place so for this we'll need to restart this
1072.68 -> engines and let me give you a quick skip
here so if you'll do duplicate skin here
1079.28 -> so this will reload and we don't have to
wait if we do restart we'll have to wait
1085.28 -> for a longer time to get it restart but now we
can see the Jenkins and the promises will be
1091.16 -> working fine so as to check let me go to the
URL and let me check p r o m e t h e u s here
1104.06 -> okay this might take some time
okay I'll be coming back to this
1110.36 -> once again so let me remove this from
here and let me p r o m a t h e u s
1121.4 -> okay let's wait for some time
I'll be coming back to this so
1126.2 -> let's go back to our server and let me pull the
two images so one will be Prometheus image okay us
1141.38 -> so it will be rolling the promptius image
1145.16 -> and I'll also be pulling the graph an
IMS for that I'll be needing that as well
1153.5 -> okay let's go here and let me type
the URL so that it will be loaded
1162.62 -> okay so here we can see these are the real-time
data that uh from this had collected from the
1168.44 -> genuine server so here you can see there are many
many many things regarding it so let me scroll
1174.32 -> down here and let's see if there is something
related to that means so here you can see
1178.46 -> type zenkins Health set duration summary so for
saying the Jenkins Health we can see here for uh
1185 -> and other things Jenkins project around
so if we create multiple projects and
1188.72 -> if you want to come to the project
status we can check by using this
1192.14 -> commands and so there are basically
many things so we'll be looking at it
1201.2 -> once again so let's see Docker images so
here I can see I have a Prometheus images
1207.08 -> on my local machine so let me clear
the screen and let me pull the grafana
1216.02 -> image as well so let's see
1221.24 -> okay so it started pulling and now I'll be
1229.04 -> so it's already a image so we do not need to
build it but if it was a Docker file we need to
1235.4 -> build it so that it converts it gets converted
into an image and we need to run the image for
1240.98 -> making it into the Container or transferring
it into the Container so as of now I have
1245.48 -> two images of grafana and Prometheus
inside my local machine so I need to
1249.44 -> run the images to create a container out of
it so to create a container we'll be always
1255.38 -> requiring a image and using one image
we can create thousands of containers
1262.1 -> so that's basically the thing let me clear and
let me run so let me do Docker images first
1271.52 -> so here we can see there are two images
Prometheus and graph Anna so let me do
1276.5 -> dockerps so dockerps will be showing the
running container and if we want to see
1280.7 -> con all the containers that are running as
well as in the step stopped state so for
1285.08 -> that we need to run this command dockerps
hyphen a and it will be showing us all the
1290.66 -> containers that are currently on our local
device or the system so let me clear my screen
1297.44 -> and let me run the container so for running
the container we have Docker run hyphen d
1303.74 -> iPhone P for the port but first I'll be giving a
name to my container so it will be my Pro met lcus
1312.38 -> Prometheus I'll be giving from the SEO
anti-container and I'll be giving the put so as I
1318.62 -> mentioned earlier Prometheus will be requiring the
port 1990 and I need to give my image name as well
1325.46 -> so this basically will do the thing so let me do
dockerps and here we can see there is a container
1333.86 -> and it has a con Associated container ID there
is an image there is a command and it shows the
1338.84 -> created status so here we can see it's created
four seconds ago and there is a status as well
1343.64 -> so the container is up and running since three
seconds ago and the port that is uh the container
1351.26 -> is currently listening is 1990 and the port that
is exposed on the host machine is also 1990 so
1357.08 -> you can put any port on the host machine but
the container Port must be set to 1990 else the
1363.02 -> from this container won't work and again let
me do one thing let me rerun the same command
1369.44 -> with a name let me give it graph Anna container
z-r-a-f-a and a container and talking about what
1377.72 -> it listens on the port 3000 and the container
port 3000 and talking about emails my image is
1392.24 -> foreign so clear let me do dockerps hyphen PS
only so here we can see I have a two container
1404.06 -> one is uh Prometheus and another is grafana so
let me enter inside the Prometheus container so
1409.64 -> for that I'll be needing iPhone do you have
an ID and pin slash sh here okay looks like
1424.7 -> I think I do not need this
Docker exec hyphen hyphen help
1434.66 -> okay so I forgot the container to container name
that I was going to enter inside so here let me
1442.88 -> write the container name so my container
name is p r o m e t h e u s Prometheus
1448.52 -> c-o-n-t and let me run this so I am inside the
Prometheus container let me clear the screen
1453.98 -> and here you can see I'm currently inside the
Prometheus container so I will be going inside
1459.32 -> Etc and Prometheus and let me do LS here
so here we can see there is a file with
1465.56 -> the name prometheus.yaml so for this I need
to change the file content inside this from
1470.66 -> cs.ml so for this what I will be doing
is I'll be opening it into my editor and
1482.72 -> okay so let me open the Prometheus dot EML file
and let me go back here and here you can see
1489.98 -> there is a job name so I'll also been needing
to provide the job name here so for this let me
1496.46 -> go to my insert mode and okay looks like I might
misconfigure here so let me go back down here and
1508.7 -> okay I'll be writing here so this is a ml file
1516.26 -> so my job name will be j-e-n-k-i-n-s Jenkins and
1525.68 -> Matrix Path so for the Matrix Path I need
1532.46 -> Slash from it here since our data is on the
1537.74 -> on this URLs you are p r o m e t
h u s so I don't want my mistakes
1546.08 -> static underscore Co and fiz
config and inside this we need
1553.1 -> t-a-r-z-e-t-s Target so my target will be
1559.52 -> Okay so my target will be
my IP address 159.138.93.148
1568.82 -> colon 8080 so this is my Target and this is my URL
or the root for collecting the data so yes pretty
1580.04 -> much we need to run this so before running this
what I want to do is uh I'll be needing Okay so
1587.6 -> where is this coming from so let me copy this so
there were other things as well so let me do one
1594.14 -> thing let me save this so after saving let me get
to my prometheus.tml file okay so doing this here
1604.22 -> I can see so let me copy this and let me check if
the ml is valid or not so let me copy this from
1610.34 -> here to here and let me copy so after copying let
me go to my browser and I'll be running y a m l l
1618.8 -> i n t so this is a ml validator so after going to
this website let me paste this and check if the
1627.5 -> okay so it shows the yaml is valid so we have no
problem in our EML file so let me clear the screen
1634.7 -> let me exit out of the Prometheus container so
when I am inside the Prometheus container so let
1639.44 -> me do CD here I'll go to the root and okay let me
exit out of it so right now it's showing me this
1647 -> and when I exit out of it we'll see root at
the rate is she has laravel so right now I
1652.22 -> was inside the container so this was the uh
inside the container so everything I did was
1656.66 -> inside the container so right now I am back to
my server and I will be doing the docker restart
1663.8 -> Prometheus container so this will restart my
Prometheus container after restarting let me
1668.96 -> see the docker container status so let me clear
the screen first Docker PS will do the thing for
1676.22 -> me so here we can see there is only a graphana
image right now so let me do Docker PS hyphen a
1683.6 -> so it shows are exited okay let me do one thing so
1692.18 -> let me go here let me copy this
once again and let me paste it
1696.14 -> there so let me copy here and let me go Docker EX
1701.54 -> it Prometheus
1708.74 -> c-o-n-t
1712.94 -> bin slash sh okay so my promises container
is not working so it will not be allowed
1719.48 -> to do this so let me do one thing so let me
remove my container and I'll be creating the
1726.44 -> from chess container once again so for this
let me do Docker RM and Prometheus container
1732.44 -> so clear and if I do Docker PS hyphen a there is
no Prometheus container so previously in uh using
1741.14 -> this command it was showing the stopped container
as well but now there is a single container which
1745.52 -> is off and running and that is graphene we
do not have any other containers so let me
1750.32 -> run the container once again talk or run hyphen
D hyphen P iPhone name let me provide it a name
1757.46 -> first so p r o m e t l g u s c o n t and let me do
one thing what I need to do is I need to provide
1765.44 -> support to it so my host machine Port will be 1990
and my container Port also will be 1990 and let me
1773.36 -> provide me my image name so this basically does
the thing for me and let me do Docker PS once
1779.36 -> again so there will be two containers so we can
see there is a permission of Prometheus container
1783.68 -> as well and which is running since to Second Saga
and it's listening on the port 1990 on the host
1790.34 -> machine as well and inside the container as well
so let me clear the screen let me do Docker exec
1800.3 -> bin slash ba sets are that you have on the sh cell
here and let me give the name Prometheus container
1808.7 -> so here I am so let me go to my Etc Prometheus
and let me do LS let me vi to prom me this
1818.36 -> dot y m l let me go to the
1824.42 -> thirst and I'll be removing all the
contents here and I'll be pasting the
1829.58 -> code that I have already generated on the yml
lint so running the EML file that is located
1837.74 -> there it will work pretty well so let me remove
all the contents here so at first let's see
1849.86 -> okay so we looks like we have deleted every
content here so let me copy this and let me
1857.3 -> paste it here so let me okay ESC column WQ let
me get to my prometheus.yml so it's working fine
1867.56 -> let me clear let me exit out of it let me do
Docker PS I can see two container running which
1873.56 -> uh so Prometheus was running is been running
since a minute so let me do one thing docker
1882.56 -> free start my Prometheus container so
this will restart my container and it will
1888.38 -> spin up the container once again so after
doing this let me do Docker PS once again
1896 -> okay it still isn't broker PS hyphen a
1902.42 -> looks like we so let's check the logs of
the Prometheus what might be the issue
1907.52 -> so if the container is stuck we can do nothing
about it we need to remove it and we need to
1913.22 -> edit so as I mentioned earlier typically it
is not suggested to work around like this
1918.26 -> so if this does not work I'll be using the
docker file as well so let me go here first
1922.52 -> and Docker and logs let me check the logs of
Prometheus container what might be the case
1929.18 -> so for this here we can see file HC Prometheus
Prometheus there to AML parsing EML file let's
1934.46 -> process on Marcel error on line 17 static config
not found type static config scrape config okay
1942.08 -> let's see here strip config Dom name promises
okay Matrix path static configs okay looks like
1951.08 -> we must provide the static configs here and
for Matrix so the Matrix Path might work so
1959.6 -> Matrix underscore path and static underscore
config looks like my own okay so this must
1967.16 -> be working what might be the case okay let
me check it it shows me the valid EML here
1974.84 -> let me do one thing my job name is my Jenkins
Matrix Path is my slash Prometheus static
1982.04 -> configs is this and my target is this so
everything looks good so let me clear this
1990.92 -> and let me do one thing let me go back to
this here we can see we have a Prometheus
1995.36 -> and for writing the docker file it shows me
this so first let me write this Docker file
2001.78 -> and I'll be requiring so let me make a
folder here mkdir Pro m-e-t-h-e-o-s inside
2008.86 -> my server and let me go inside my Prometheus
server let me do LS here so let me create a
2020.92 -> file here and
2024.88 -> let me copy the content here let me paste it here
let me save it let me clear the screen and what
2031.06 -> I'll be doing is here we can see I need to add
a Docker file to it so for this I'll be writing
2036.82 -> and I'll be pasting the okay not this
2051.28 -> okay so I'll be writing the sets of
2055.24 -> instructions here so from an ad so I'll my
base image is from p r o m e t l c u s and
2063.16 -> what I need to add is I need to add Prometheus p
r o m e t h u s dot y a m l to my Etc slash bro
2078.28 -> M okay let me do one thing p r o m e t h e u s
and let me give here so y m l and yml are same
2087.82 -> so I don't want this to be an issue I will
be saving this with y m n and I'll also be
2094.12 -> naming my prometheus.aml with Prometheus Dot yml
enter so let me remove my previous Prometheus Dot
2102.52 -> yaml okay so here we can see this is my folder
structure so I'll be building the docker image
2110.2 -> so for this Docker build and from me 3s IMG Dot
okay so I need to provide a tag here first so
2119.02 -> this will be my tag and the dot refers to
the look look at the docker file that is
2124 -> on my content current directory so let me into
it enter and so this the image has been created
2130.24 -> successfully so let me go back here and let
me run this once again let's see if this works
2135.64 -> perfectly fine so let me go to my root directory
let me do LSR so let me do docker images
2145.24 -> so here we can see I have a prom Prometheus image
which is uh the default image and this is the
2151.18 -> image that I have created using my Docker file
so let me do Docker run iPhone D Dash test name
2162.88 -> my p r o m e t h u s c o n t and I need to provide
what do I need to provide is I need to provide a
2170.2 -> port 1990 following 1990 on the container machine
as well and my Prometheus image name is promi th
2179.86 -> from it TS us I am z p r o m e okay I mispelled
this if I misspelled it this won't be working so
2191.56 -> p r o m e t h u s IMG enter okay the content of
name presences okay so let me do Docker PS Dash
2199.78 -> a so there is another Prometheus container that is
currently in exited state that we created earlier
2205.18 -> so the there is a conflict with the container
name so let me remove this container with the name
2210.58 -> Prometheus container and let me clear the screen
and let me read on the command once again so this
2215.74 -> will work perfectly fine so let me do Docker
PS once again and we could see that we have a
2223.12 -> Prometheus running so let me go to my browser and
let me run access the dashboard of Prometheus and
2232.54 -> graphene and for that what we need to do is
we need to run the IP address here and the
2238.6 -> port so this will open my graphene and this
will be opening my Prometheus dashboard so
2246.76 -> these are the dashboard that are provided by
Prometheus and graphana so here we can see
2253.54 -> okay so looks like our Prometheus is successfully
2257.98 -> recognizing the zenkins so the things
that we wrote here so let me show you
2263.98 -> see the Prometheus and here there is from this
30ml Prometheus dot EML so the thing that I
2271.48 -> specified here so job name will be zenkins Matrix
Path will be from the Prometheus and the root path
2277.84 -> will be the IP address the port 8080 since we are
passing the zenkins metrics so we need to access
2282.82 -> the genuins first and this would be the URL where
our data will be stored so basically this will do
2288.94 -> the thing for us and let me go back here and let
me check Jenkins up so if I'll execute we can see
2298.48 -> the instance is up and the job sentence
is up so basically this is the thing so
2303.1 -> there are multiple metrics that we can do
so checking each and everything here and uh
2310.48 -> inter error format processing so I'll be requiring
passing other parameters here as well so for this
2316.84 -> I will be going to graph Anna directly and we'll
be checking there so for this it is asking me the
2323.56 -> email username so by default the default username
and password is admin admin so let me enter the
2329.56 -> admin admin so it asks me for new password so
I'll be providing with the new password and
2334.96 -> this is my new password let me submit it so looks
like I am successfully redirected to My Graph Anna
2343 -> so as I mentioned earlier here you can see
graphana is a visualization and analytics
2348.34 -> platform that is used to create and display
dashboards and graph of the data from the
2352.54 -> various sources including Prometheus it
allows user to easily create and customize
2356.74 -> graphical representation of their data and
to interact with and explore the data in
2361.48 -> real time so we will be interacting with our
data in the real time so using the dashboards
2368.32 -> so let me remove this will not be requiring this
once again we also don't need this so let me go
2374.08 -> back here I'll also not be requiring this but
let's check here inside the status graph okay
2380.62 -> so everything looks fine so let me go back to
my Prometheus and let me add a data source here
2386.44 -> so for this what I need to do is so add
your first data source let's go here and
2393.64 -> since our data source or the data is from being
provided using the Prometheus so I'll be adding
2399.58 -> the data source as my Prometheus and after
clicking on the Promises we do not need to
2404.92 -> do anything we just need to provide the URL
so for that URL I will be going here and I'll
2409.84 -> be checking the Prometheus URL 159 okay one
five nine dot so this is my Prometheus URL
2420.4 -> okay so let me copy the Prometheus URL
till the port and let me paste it here
2426.94 -> and let's do a seven test one once
and let's see if it's work okay data
2433.78 -> source updated and data source is working so
here we can see the data source is working
2438.82 -> and so type is from here so this Let's ignore
this we do not need this right now so let me
2446.14 -> it's already saved so let me go back to my graph
Anna and here we can see there is a dashboard
2452.26 -> option here so new dashboard I will go here and
I will be adding a new panel to my dashboard and
2459.64 -> so the magic lies here so here we can see
2463.84 -> The Matrix so let me extend it a bit further up so
let's see the metric here and before that let me
2477.1 -> go back here let me provide
my username and my password
2482.14 -> and after entering it I'll be redirected
here so let me go to dashboard once again
2489.28 -> and inside the new item I'll be creating
a dfault zenkins it's third test d-u-m-m-y
2504.88 -> okay so let me go here and I didn't
mean it to be test but let's see
2514.9 -> okay so let's copy this and let me
go back here and let me write my
2521.68 -> so this will be my job one it will be Pipeline
and for the pipeline I will be entering the
2530.68 -> so this is how we basically write the
pipeline so let me apply and save this
2536.44 -> and let me build this so after building let's
see what it's going to show us the status
2543.7 -> so here we can see the build result is
successful and first we'll created the
2548.68 -> build output and archive the build
output so this can be seen from
2554.8 -> okay so let's see the pipeline what we had wrote
and how this is working so for that I had not
2559.72 -> planned to provide this in this video but let's
see on the configure so here is our pipeline so
2567.76 -> there are two stages one is create build output
and another is archive build output if we want
2572.38 -> another steps to be added we can easily do
that by adding as much stages as we want
2580.96 -> Okay so archive build revert this is my second
so this is my Phi are the third Bill report this
2589 -> will be my fou RTS fourth build report okay looks
like I pasted multiple times so this is my first
2600.94 -> okay let's rename it to sixth
2606.22 -> and let's rename it to 7th SCB and TS
so I am doing this so that it will be
2612.4 -> easier for us to navigate here so
let me do the build and let's see
2617.92 -> let's see let's see let's see how it will be
working so here we can see we have five stages so
2626.38 -> pretty much this is how the things
work in Jenkins so let me go back here
2635.5 -> and let me again write a job to and let me give
it a pipeline and I'll not be adding a pipeline
2644.8 -> here and what I'll do is I'll try to build this
job without a pipeline so let me see what status
2649.6 -> will it be showing so this is the success status
and we might see the Euro status here so let's see
2661.42 -> okay so here we can see the star so the build
field let me build it once again so it will be
2667.12 -> showing the failed build once again so let
me go here and here we can see this is the
2671.14 -> failed status so we always need the success
status for our job to be running successfully
2678.76 -> so let me go back here and let me select
the Matrix so here we can select the metric
2685.48 -> okay so let me check the last build Health score
so here we can do basically is we can select the
2691.48 -> instance Matrix as well we can select the Jenkins
job as well so for zenkins we can see there is a
2696.52 -> job one since the job one was successfully
built so you we can see the build here and
2705.4 -> let me give a panel limb
so this will be my zenkins
2709.36 -> vuild score and here is the real magic so
these are the visualization that we can
2718.24 -> look after the Matrix so we can view
it in the form of Time series we can
2723.94 -> view it into the form of bar graph
or bar chart stat Gods so let me
2729.94 -> pull this down and let's see on the bar chart
so 100 success so since our job was successfully
2737.56 -> completed so here we can see inside Zog oh sorry
inside the gauze also we can see this let me
2743.74 -> apply this so here we can see this is our new
dashboard and if I want another panel to be added
2748.78 -> I can easily add this from here so once again I'll
go down here and I'll be selecting The Matrix so
2753.82 -> for now so for this I will be selecting the build
field and the since the Builder was filled of uh
2761.8 -> zop2 only so here we can see the Jenkins serve and
based on the genuine sub there is a job to which
2767.32 -> has the builds that have got filled so let me run
the query for the job to and let me failed build
2778.84 -> Okay so let me select this one as stat for now let
me apply so here we can see fail build is this so
2792.34 -> okay so let me go here
2796.96 -> okay let me go to console output now flow so
this is the error that is calling causing the
2802.36 -> failed build so here we can see no flow defined
cannot run finished failure so this is the main
2806.44 -> reason that it's showing here so I don't know what
status this is showing so we can select it to be
2818.44 -> okay so here we can see I had selected so
this might be the build status or build ID
2822.94 -> so every time the uh Bill gets uh triggered
it performs the build with the build ID so
2829 -> this shows the build ID that or the job
ID so this had not been successfully
2836.86 -> executed although also there are multiple so
let me go with the instance now so for instance
2843.82 -> no options so let me so since this
instance won't work with job 2 I need
2850 -> to provide it with IP address so here is my
IP address and here we can see the Matrix for
2854.74 -> this configuration so let's go back and I want
to pull this a little bit up and let's see
2862.72 -> so let's see the plugins that
are installed on my machine so
2868.12 -> plugins failed so since there are no failures
of plugin that I downloaded right now so this
2875.74 -> might not be showing anything so here we can
see there are no plugins that are that failed
2884.08 -> for the installation so let me see how many
plugins are currently on my system and let me
2890.98 -> also do the build count so here we can see the
durations of durations of execution time is up
2898.42 -> block duration helps X score so these
are the metrics probably and will be
2903.28 -> selecting the specific Matrix for a specific
service monitoring so yes please try it uh
2908.86 -> on your own and uh you can check the specified
build as well so let me do add one or two other
2917.74 -> thanks to it so for this let me go and let me
Jenkins queue pending then can skew Jenkins run
2925.48 -> success total so let's say we have a successful
run as well and so for this let's not do time
2931.48 -> series I'll be doing the stat s so these are the
builds that failed so here we can see we have two
2937.84 -> builds that filled and let's go here and let me
go to dashboard and let me go to job2 so there
2946.12 -> are two builds so this is the first build and this
is the second build and as I mentioned you earlier
2952.06 -> okay let's see here console output
it might not be giving anything okay
2961.48 -> so okay so this is the status that the graphene
is showing here and if I rerun it once again so
2971.14 -> build now
2977.62 -> okay so this might need to refresh
2985.54 -> okay let's check
2993.16 -> let me apply this here and let's do a refresh
3005.4 -> okay so last five minutes let's see
3019.44 -> so that uh isn't getting rendered here so let me
3025.74 -> check the field builds once
again and let's see if it gets
3032.7 -> okay for Matrix let's go here and
3036.66 -> build failed count and last build duration
millisecond last build result so let's see
3041.22 -> the last build result of the Jenkins serve of
job 2 let me run the query sorry and let's say
3053.58 -> okay so since the job hadn't uh been
built so there is no message as well so
3058.8 -> this shows the zero message has been
provided here last will result and
3065.34 -> so yes basically this is the thing we
need a lot of troubleshooting here and
3071.7 -> we can also add other data sources as well so I'll
be saving this dashboard for my later reference so
3081.3 -> so this was basically the thing so in the
upcoming video I'll be showing you with other
3087.48 -> metrics as well so these are not the typical real
life scenario Matrix that we take care or handle
3094.92 -> with so I'll be bringing you bringing you with
the real life scenarios and the examples as well
3101.76 -> on the later videos so for adding data source
there are other multiple options as well so
3108.36 -> let me go to data source and let me
add data source so here you can see
3113.82 -> we can add data from graphite influx
DB open tsdb low key elastic search
3120.48 -> so they got Tempo Zipkin and for SQL we can
provide data from MySQL postgresql Microsoft
3127.62 -> SQL server and from cloud Azure monitor Cloud
watch for AWS and Google Cloud monitoring for
3133.08 -> gcp and for a graphene Cloud we have graph on
a cloud itself an Enterprise plugin that we can
3140.52 -> add as a data sources app Dynamics Azure devops
so Azure devops is a service that is provided by
3146.7 -> azure so it basically works with the principle
of devops and we can also add data din address
3156.12 -> gitlab and so there are many other plugins as
well so if we go to official Source there are
3162.36 -> other much more plugins that are available so
I'll not be going into that deep right now so
3167.82 -> for exploring we can go here and we can
see the things that are available here so
3177.6 -> yes basically let's end the video today here
and I hope everything is clear to you and let
3184.26 -> me show you the containers so these are the
two containers that I'm currently using and
3188.4 -> this were containerized using Docker and so at
I had planned previously I'll be running the
3193.62 -> con image only but since the Prometheus did
not work as we need to provide the job type
3200.76 -> zenkins into its prometheus.aml file so I've
created a Docker file for it and we passed the
3206.88 -> we passed two instruction on it and so so the two
instructions were from an ad so what we did was
3216.06 -> from an ad so from reflex the base image so it
was from slash p r o m e t h e u s and we added
3224.4 -> Prometheus t h e u s dot y m l to Etc slash p r o
m e t h e u s so this is from my end local machine
3236.22 -> and I am trying to add this from my local machine
to my Docker container or this talking about it
3241.8 -> let's not call it local machine let's call it
host machine so this is from host and this is for
3249.9 -> for the path to my container and this is my image
default base image so it will take the Prometheus
3259.38 -> image and it will add this onto my Etc Prometheus
so basically this is the thing so I hope
3270.6 -> the concepts regarding the monitoring using a
Prometheus and grafana for Jenkins is cleared
3277.08 -> so we can use it for other types of services
as well so thank you for today thank you
Source: https://www.youtube.com/watch?v=1HTixoBIdYw