1. Metrics Monitoring: Spring Boot 3 -- Prometheus -- Grafana

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video we are going to check out the observability of symbol 3 especially the metric pillar by enabling product 3D features using actuator in this simulate mode we are going to deploy one screen boot app on localhost port 8080 and explore the metric and point for meteors and Slot act two thirds last from meteors the second component is for meteors it plots using Docker compost so that's quite in the docker Network and for example if you want to script data by calling localhost it won't work here for development and demo purposes in this video we are using the spectral DNS name host.co.internal which resourced to the internal IP address used by the host machine the last one is profaner employed using dot could compose as well so it's in the same network at Prometheus and can interact to the meteors by calling through the domain name Prometheus okay let's go ahead and start creating a simple springboard application here start of string the eye out radio we're going with swing by three dot cloud hair low service 17 and we would like to have a quest and obviously the actuator okay okay then put this here unchip it and opened IntelliJ but CD I'll serve it IntelliJ okay let's run the application and you see exposing one and point are two thirds those applications started on about 8080 right then let's accept it one low up two thirds and you'll see only Health endpoints is exposed here so this is also the default endpoint was exposed by the actual term can take a look at here and you'll see this exposing Imports so by default only Health endpoint is a sport okay let me get update I will change it to yaml refractors and management and posture so by default this is the default and this time I will Prometheus mm-hmm okay try to stop and regret it again I would like to expose the remedial endpoint here and check it okay it's the same so obviously we need some dependency for meteors and we need to go here to we're going to add a runtime dependency and this one is micrometer remedies okay let's add this and reload riddled okay let's restart again so by have the dependencies barometer restrometers and the remedias and toys exposed in configuration file I hope we should see the remedies endpoint here okay now we as there's the remedies endpoint and we can click it to say this is the endpoint that you know the metric returned by remedial endpoint that's it for the first part on the next step we will go ahead and create a Docker compost to deploy Prometheus and ravana so I will create a file Docker composed yamo here and in this one person three services and romitias Prometheus this one the container name I will name it romitiast that's not a Services named rafanari refiner and the container name mirafana okay is image and restart or wait and extra host we are you know we are defined a mapping here so we are going to use the host Docker internal to map to our localhost outside right house dockerd internal hosting a grid and the comment is conflict fault and we have to copy the config file from our local story to the Dockers so we're going to write a config file here we're in foldered name the card and in Docker I will return second folder named romitias Prometheus and I will put the remittance configuration file here for Prometheus and this one went to the local mall I will follow the hero key here curometers [Music] and I will put it to the ETC folder in dockert so whatever you like the uh right and I'll copy this one here and put here okay so good so next one is like poet and 1990 1980s it's default pork Prometheus for rafana simpler images [Music] okay and port it's not the default operational tweet thousand okay three thousand two thousand okay now let's go ahead and create some configuration property for meteors so we'll start with global and scroll interval of 10 seconds evaluations for um so this is the important one the scrap config will script data and we have job name here I will name is hello serve it um then metric is it should be a Twitter paramecius and the static conflict Target then I will host dockerd internal 8080 so you can see in your Prometheus will start and straight data from this domain right domain and by we are defined in Docker compose this domain we will Mark to the internal IP of the host and that's why by using this domain we can connect from inside the docker Network to the localhost of the host machine okay let's try to run it for the terminal.com compost then Prometheus and rafana is ready so we can accept kilometers at 1990 and rafana app three thousand okay we have local hot 1990 and then we will see it look hot it's not successfully and let's see you know for example we have some Metric like activities of a request to here okay let's try to find that here yeah and you can see all the the metric will be listed down here okay so basically draw material quote perfectly pulling data from this uh endpoint and the second thing is take a look at grafana so as a refer now we want to set okay the focus named password means they are the same right half mint [Music] okay never and now you be asked to change the password but I'll skip it this time and the first thing you need to do with graphene is that data sources okay so set a bit Prometheus and so in here I will put the URL and you see in roughner because reference is same token network with no meters so I can use the romitias they contain nanometer as a domain to connect to yeah okay from BTS players and by default meteors will run at Port 1990 okay that's this so I will seven Tessa so okay successfully very formal meeting apis okay so now we have data sources we can start to create a dashboard so in dashboard here so I'm I think I'm going to so we can create a Dust Bar manually or we can import how I will import this time and I will graph for now for another dashboard and in refund dashboard I'm going to to search for some zvm machine and for example I I like this one tap find new downloads okay then now and I'll copy the ID here 4701 right then I'm going to import it here uh important spot from roughner and okay I'll keep anything for simple I'll keep anything the same here the name foldered you can do it whatever you want but you have to set up the data source and the data source is the remittius that we just set set up previously import then you see there's some that data pop up here and it means that roughner is successfully connected to remedial to script some data and so in it does more so now we are successfully go through and tie the diagram here and yeah thank you for watching hope to see you in the next video thank you again
Info
Channel: Linh Vu
Views: 7,950
Rating: undefined out of 5
Keywords: prometheus, grafana, grafana dashboard, spring boot, spring framework, actuator, spring actuator, micrometer, docker, docker-compose, docker compose
Id: U9KVXWbUVbA
Channel Id: undefined
Length: 15min 37sec (937 seconds)
Published: Fri Aug 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.