How to Setup a Grafana Dashboard Step-by-Step | Grafana Tutorial for Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in today's video i'm gonna show you how to set up graphvana step by step my name is talha and this channel is all about showing you how to become a highly paid it pro really really fast [Music] so let's get started graffana is a platform which is open source and it is used for data monitoring analysis and data visualization one of the major point of graphena is that it allows you to bring several different data sources together at one dashboard as we know that there are several steps in software development lifecycle and some of them are development integration testing deployment and monitoring there are a number of tools available which can be used for maintaining the code like github for example so for monitoring purposes we can use graphana which help you to monitor the data in real time used in different applications so the question is that why do we need the continuous monitoring well the answer is that there are several reasons why we need continuous monitoring for example it allows us to have better response rate as it alerts the respective person of team right the time of an instant emerges so eventually it also ensure that functionality gets achieved every time in result it ensures the minimum downtime of the systems and it also ensures the availability of the systems at the optimal operation level so all these features ensure that we are achieving the functional and up to somehow the non-functional requirements of the systems so the question here arises why we choose rafana over other tools the answer is that it allows us to have data representation in different forms like charts graphs and it gives us the functionality of having the alerts which is super important apart from that it is multi os supported for example we can use it on ubuntu windows mac and also it supports multiple types of data sources let's get to graphvana and understand it so go to graphvana we have to use localhost and then colon and then 3000 port in our browser so we'll go to localhost colon 3000 as you can see we are on the home page of our graphvana here on the left side bar we have different options as you can see we are on the homepage of our graphvana so you can say that why we are at the dashboard the thing is that we'll show you how to install it later let's discuss the dashboard here on the left side bar we have different options for now we'll see the plus sign and the settings button when you hover upon the plus sign you can see that we have option to add dashboard which we will do eventually click on dashboard and now click on add new panel from here we have different options to use under the visualization part we have several options to choose from for example we can choose the charts graphs time series and stats etc we can do so uh and we can select any of that for our data representation and right now you can see that we have no data that's why it's showing us no data we have the option to choose our data source and select the fields to choose from now let's get back and go to the settings button when we hover over it we get the option to add data sources click on add data source here we have different databases options to add into graphana in our case we'll choose in flux db but first let's go to the installation part and let me show you that how you can install grafana on your machine to install graphana go to the official website of graffana and there will be commands to follow to install it we'll install on linux you can install it on windows or mac so follow these command that you see on your screen so i have written those commands in a separate file and you can pause this video to follow those commands to install the graphana or i will also paste them into the description of the video so you can copy paste those commands from there to install graphvana on linux so now i'll just quickly copy paste the commands and run them one by one so i'll fast forward this video from here but you can copy all the commands from the description and you can write the same thing so we have installed the graphana server now we have to start it as you can see our graphana server has been installed successfully and now it's time to see its status for that go to port 3000 and you will be able to see a page something like this as you can see it's working fine now let's enable this as we are done with installing the graphana we will now install the influx db to install influx on your machine go to influx data dot com from your favorite browser and then you will see a page something like this there are commands to follow to install the influx on ubuntu and i have written those commands in a text file you can pause the video or you can follow those commands from the description i'll also put these commands in the description you can copy paste them from there and then you can run them on your terminal so i'll run those commands one by one as we are done with installing the influx db here you would see this big influx db on your terminal now we are going to enter our shell of influx write this command on your terminal like influx and hit enter so now we have entered the inflex shell as we have installed the influx on our machine let's see how many databases we have in our influx database so for that use this command show databases hit enter so here you can see that we have multiple databases when you will install it for the first time you will just see internal database which is there by default these other databases are the ones that i have created myself let's make another database named as corona 19 using the command create database corona 19. so i write here create database and then i would write here corona 19. if i hit enter you can see that it's successful we have not had any errors then if i do show databases there you can see that we have another database with the name of corona 19. as you can see that we have successfully made another database now we are going to use this database using the command so for that we'll just write your use and then the database name which is essentially corona 19 and here you can see that we are shown the result using database corona 19. so now we are using it now we will switch to graphvana and we will activate corona 19 database into influx db so let's go to grafana tab here in the home tab and now what i'm going to do is that i'm going to go to the settings button and click on data sources and here click on add data source from here we will look for influx db which is essentially right here click on select we can change the name of data source or we can leave it as it is we'll leave it as it is now after scrolling down in the url section write the url for localhost and port number 8086 as it only runs on this specific port number after scrolling down further we will add our data source name which in our case is corona 19. so we can see our data source is working fine now let's get headed to create our first dashboard and for that go to the plus sign and once you go to the plus sign hover over it and add the panel for our data i want to add world map and by default we do not have the world map panel and for that purpose we have to go to plugins so search on the internet grafana plugins click on this first link that you see right here so from plugins we can see we have installation part of world map right here from here we can copy the link and paste it in our terminal to install the world map panel so for that i will quit the shell i'll clear it here i'll paste this command and i will hit enter and it will start to install the world map plugin on our system so i forgot to do sudo so let's just sudo it and here you can see that now it has removed the error after that we will restart our graphana by using the command sudo service graphana hyphen server and then we'll type in here restart hit enter and now we have restarted the graphana and here you can see that we do have a world map panel here so now we need to have our data set so we will go to track corona dot live slash api and i will just copy the link of the file from here now i'll go to my terminal and i'll paste the link here after writing sudo w get command here i am going to enter my password and it would start to download this so here you can see that we have downloaded it successfully so now i will create my first python file to code i have already created it and as you can see that i have written down the code here you can follow the same steps to do the code here and you have two choices either you can code using the terminal or you can code using the python file so here you can see that here i have my python code first of all i have imported the pandas and then i have used the influx db okay and here you can see that i am importing the corona file that we just downloaded using our terminal simply what i'm doing here is that i'm using a for loop to basically get all the fields from that file and here you can see that this is the database that we just created in the influx db and again this is the file that we just downloaded and it had these fields so we put a for loop and here we have all these fields right here so what it would do it would pick up the data one by one from this file so here you can see that in the for loop we have measurement we have tags we have fields which are like name country latitude longitude metric okay so these are all the fields or this is the like the json body that would be picked up from this file and we have used for loop to pick it one by one so what i'm gonna do is that i'm gonna put this code in the description so that you can copy paste it from there and use it and the thing is that if you do not have pandas you could install it using sudo pip3 install pandas when you write this command and you hit enter it would install it so i already have it now for me the next step is that i'm gonna go ahead and i'm gonna run the map.py file of python and i'm gonna see if this file runs smoothly and it does not cause any sort of error and here you can see that on the output all is done it means that we do not have any errors and on top of it we see that we have dimensions one of them is 230 and one of them is eight so 230 means that it has 230 records or it has 230 rows and eight means that it has eight columns in the countries file so now we will go to our dashboard and we will create the panel for data visualization for that purpose we will select our influx db3 and measurement as govid map so once we do that then we will add our fields and after that we will format it as a table so here you can see that i have selected my default as govid map and now i can start and deleting the extra field i can start adding the field that i want so here you can see that i can add this field right here i can remove the extra one that i have here i can add this one and i can remove this one which is extra i can add a new field i can remove all the extra fields which i do not need so i'll quickly add all the fields that i need so from here i need to select the format as table so once i have done it now i will go to my map data option and from there we will click location data and we will select table and in field mapping option the table query format should always be coordinates so once we have done that we will go to our map data option and from there we will click location data and we will select table and in the field mapping option the table query format should always always be coordinates and here you can see that on my world map we could see the data we have green and we have red we have orange like we can change and set the threshold value for each color and here you can see that we have different threshold values and we can select any of that so here we can even change the colors and previously we have seen that how we can change the threshold values here you can see that i have set a threshold of 100 to 10 000 right so when the threshold value would be less than 100 it would be green and when the threshold value will be between or in between 100 to 10 000 then it would turn out orange and if that exceeds if that number exceeds 10 000 then it's going to be red okay so now we have made those changes so let's go ahead and let's try to reload the map and let's see if the changes have come so first of all we'll apply it and now you can see that after we have applied the colors have changed and the changes that we have done have taken place so that's it with this data set we can use several data sets to visualize using the graph fana and it's very easy to maintain and arrange them thank you so much for watching this is it do not forget to subscribe to our channel for the latest videos to help you advance your i.t career
Info
Channel: SkillsBuild Training
Views: 154,067
Rating: undefined out of 5
Keywords: grafana, monitoring, monitoring tools, influxdb, grafana dashboard, data visualization, network monitoring tools linux, data visualization examples, data visualization tutorial, grafana tutorial, grafana tutorial for beginners, what is grafana
Id: kQQF9QzSSS4
Channel Id: undefined
Length: 16min 1sec (961 seconds)
Published: Mon Mar 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.