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

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign today we are starting a very important topic of grafana dashboards last time if you remember we talked about prompt dual query that are responsible for querying the time series data so grafana dashboard is completely built on that we'll be discussing today how we can create kubernet dashboard you know how many methods are there and how we can do it quickly you know quick passion because Griffin has an open source tool and how we can quickly build dashboard on top of Matrix that are coming okay so if we see the possible number of options that are available with us is we can directly import the grafana dashboard using a request dashboard ID which will be seen in a while from a official URL or we can input an existing dashboard from any other environment via Json completely in an automatic fashion and finally we can create a dashboard from scratch also this is again a very good feature which here we can you know design our own panels that is what we need like quickly jumping onto the all the available method let me you know show you the working demo so as you remember that we have already spinned up grip on our mini group Club so that is up and running I can you know simply show it to you by port forwarding with the up and running so what we'll do first of all we will import you know existing dashboard so this is my favorite one of my favorite node exporter dashboard that is available on this link this link is available into the description of this video now grappana.com so all the existing dashboards that are available you can see more than 6800 dashboards so this is a very very important dashboards where it is measuring the performance of all the kubernetes nodes that are present in your cluster right and how can I simply import this dashboard you need to come here copy this ID to clipboard and ids1860 copy this ID come to your grafana and click on dashboards and then click new okay before I explain how to import there are there is a existing folder called the general where all the dissolved dashboard that comes to the installation those are to them so I'm not going to touch anything here so that everything is clear I'll create a new folder and I'll give a training as a holder name now I'll import my dashboard into that folder so I'll import now I know 1860 is my input right upon you know.com I just simply click load now this is the dashboard I'm going to get uploaded in this training folder I can upload into train Channel folder I need to select a data post although the perimeters is the data source which is having all the metrics data I'll click import now you can see all the data has been populated pretty nicely so you don't need to do anything else you know now we'll we'll see all these things in a pretty you know minutely so that you can understand what is happening so if I do a filtration of last 30 minutes or for that matter last so last three hours this will be load that is happening how many nodes we have we have only one node because it is a mini Cube single load cluster so in your environment rate you might see multiple rows here now these things are coming so when you load a dashboard there are certain inbuilt variables that are there see the variable the data DS promises the variable variable which is throwing our parameter for the name node is nothing but pulling the the IP address of your node so these variables actually used in your dashboard okay now coming back to the dashboard panels now these are different different panels that you can simply check it suppose I want to see how much CPU is you know busy busy CPU so I can hardly say that is you know hardly one percent so how can I edit any private particular panel I can simply click on these three dots click on edit and then I'll come on to this you know query oh this is a prompt ql query so that is the reason I was explaining that from ql queries creation so let me you know explain this query again so that it becomes more clarity so I like another window I'll open explore window where I can run all time series data a Time series queries I'll copy this piece into another empty vs code or any favorite editor that you want okay now let me divide this query so that I can understand what is happening now this is a very important part to understand if you understand one panel then you have to create queries and you will understand everything okay now you can see the opening break under closing grid so I'll do it simply this and this so this is my first independent query that I'll run I'll copy this so you can see copying this piece and pasting it in the floor of this now so what is the meaning of the square if I'm saying this is my metric okay this is my metric and on this metric I'm saying uh please get the instance of filtration on the instance node in the job and when the node is not idle I mean it will be the and rate interval is nothing but here this filter okay what I'll do I'll just simply change this node take this node from here I'll discard this this is my node value I'll get it from here so that I don't want to do a copy post copy paste basically and just do this I want to explain this query there's a reason I'm foreign this query onto my this editor okay now you can see the graph what I'm saying on this node CPU seconds total how much for especially for this intense for this job node exported the system is not idle I mean system is busy again the rate function of the same Community which I explained in my last video the rate of change of metric every second and then we are doing a for last one hour and then we are doing it for you know rooting by instance if since you have one instance we will have only one record see the only one record so I can see only uh 0.1 percent is or you know system is uh uh I would say not not idle now this is the not idle situation now I need to divide it by SVG as we do the normal percentage we need to divide it by uh the overall system okay because currently I've done the filtration on this job with the with not idle I mean with system British which will be now we'll take the ticket everything okay so let me copy this query again and how I can connect multiple queries I can simply add one more panel I will simply click this icon this will disable this query it will enable this query okay and then there's a slight difference between these two queries so if you see earlier query I will doing it for for only four more equals to note I'm not doing any filter no modes this is actually a overall overall performance so I'll run this you can see now I'll simply divide this thing by this so that I can get the percentage okay you know the percentage how we do it in you know the basic mathematics so this is the breakdown of that query so if I you know I can see multiple things here multiple queries in the theme window this is how I can validate my query if I want to see this you need to you in this you will do this want to see this output of this window see that I can click on the table also now I break down these queries into multiple part now this is your first part now this you can you know consider this is another important action to understand what is this now this is actually doing a left join on instance with these two because these two results are actually the tables the time C is stable so we need to join these two things ultimately both are giving the same output but we need to join and do that yeah division to get the percentage so I'm joining it in the on the group collectors nothing but left join and joining on instance and doing that division okay if you combine this query and run it you will get this data the one percent see earlier it was close to 0.9 now it is coming as one percent so this is what it is so let me just create one more chunk here this is very important to understand that is why taking little bit more time too I'll run this complete query hoping that it could run okay people who are working in grafana they can understand it pretty quickly people who are new to grappana that will it will take some time but yeah it will settle down easily I'll run this query now you can see I can clearly get the 1.07 percentage which is coming as output in one of this dashboard panel so that is what I want you know show you that how okay and you can see the time series graph also now how you can simply remove this crop I can see the instant value and I can remove the graph now you can see the tabular format also okay so you can evaluate any complex query by breaking it down and create multiple these chunks and then you know understand what the query is doing that is what I have done and I can see this 1.07 is coming here the moment it one comes at 1.07 you can simply take the I can represent in pie chart will not make sense because it is a single value I can present this text you also will not make plans yeah so we can take anything which is actually making sense then I can do some kind of conditional formatting color and all those things those things are pretty straightforward and I can put some labels also so since it is not putting any labels that is okay if it was a single query now let me show you an example of on a complex query now this was a busy CPU no let me take the memory okay memory or the PCP basically let me edit this panel again now you'll see lot of queries in this a b c d e f what they are doing they are creating independent tables and then you know putting those tables in parallel and I think in parallel this is according it's a kind of a union union of all these data so and how we how I'm giving the label so first query label is busy system so this is what is busy which is close to 0.317 and then B query is nothing but your busy user the moment I click this pinpoint four five the key query is there which is busy low weight and so on so if you see they have done nothing fancy they have created okay how I can create this if you would really want to ask to come here okay uh that is something the third Point how I can get a dashboard manually so new dashboard forget about a lot of visualization and then I'll add all these queries one by one so suppose if I add this in my a see I'll run this we'll get some data now okay I'll add one more be and I can give one more thing I can have a multiple data course also mix but for now but today let's have only single data source I can pull in data from my Sequel and parameters I can do a transform those kind of complex query but yeah so B is nothing but your the second section right I'm telling you an example that how you can simply get the data of these two one see now you can get two data in the same panel that is how they are doing it in into the different uh you know panel this that is what I was trying to show you so is nothing but positive B is nothing but second time series data and C is nothing but third so independently they have created different different tables and then showing those tables into single graph right let me discard this so if you take any other connection let me take them storage okay okay so storage also click on this edit this similar everywhere you will find similar kind of you know scenario taking the data sort okay and then adding all those queries see they have no way they're using transform to transform is something when you want to transform it or transpose the data or do some kind of if or you know filtration on that data but for now I mean we're using only Prometheus database data source and these variables have really set over you can also create these variables microming here variables DS parameters is nothing but inner parameters data codes node is now this is again another important function that I was explaining in my last video label values and you can get those Prometheus functions here foreign [Music] so you'll see most of the functions are defined here itself if I come here label values you'll find definitely here see label replace label values must be there it is not there anyway the label replace level values you can find it on Google but this is a very important way where we can get you all the summary related functions yeah so yeah this is pretty much about how to understand existing dashboard that is very very important and how I can create a dashboard from start now and I can create links also now they have created a link of you know GitHub on the Groupon dashboard I can simply come here and read more about this dashboard how it was created and all that link to the graphics everywhere it is giving that proper link the GitHub link is also there in the grafana dashboard I link is also available yeah so yeah this is about the first item how to import dashboard from the existing grafana dashboard ID now this chatbot is very very important as for nodex protocol which will give you the the length and length and breadth of your node how it is performing whether from CPU why is memory wise Network traffic and for that matter storage wise and networking wise also I think yeah discrete ride iOS storage file system Network traffic so this is a very interesting and we can setup alert on top of it so setting up alert will you know we'll discuss it later but yeah how to create dashboards and how to understand existing dashboard that are coming from a Google or with the graph that is very very important suppose you know down the line need to modify this so I should be able to understand these queries how it is being executed like how you can break it so this let's talk about this or this uh important that could also now in this we need to understand the memory okay so memory of this particular node so I can see the ram total is was nothing but your first however and how I understood that it is my first query you know in the a go to options you can see the legend Ram total the moment you click this you'll see close to 7.6 GB and that is doing nothing it is taking the data from this metric okay instant this and node is nothing but your node exporter a b is nothing but your how much RAM is used so you can you know the total now you're subtracting the memory free memory cache and adding the buffer bytes and adding the reclaimable bytes third is listen Cash Plus offer so what I'm trying to explain it here is everything is divided derived from the metric and dashboard is the representation of that data with combining that data and whatever we've got we do so you don't need to worry too much about Corner dashboarding things are already available on Open Source on this dashboard you need to come here and then search for your requirement now if I see I want to do something related to my sequel MySQL dashboard do we have anything on my SQL definitely we should have MySQL duplicate my secret exporter MySQL from it which is again very very important Dash code so since we don't have my sequel now let's see what will happen we don't have my SQL currently on our stack if I try to import this what will happen so it will get imported but it will give you the uh what I feel is nothing will be visible in any of the panel the nna will come but the data dashboard has been imported why any has been coming because there is no data there is no metric related to mySQL so um if we if you have my sequel in your cluster or in your application you can simply import this dashboard and then customize it according to a need [Music] so that is the reason this URL is very very helpful for uh importing any dashboard now this is all about explaining your first item now import the dashboard devices now what happens suppose one of your colleague and your team have created a very important dashboard very beautiful dashboard that you need to import it directly uh to your environment so what you'll do suppose this is the this is the attachment you come here and then you click on the settings item you come on this Json model you do a control a or you can save it save as and now basically you need to export it as Json then you let me do a control a Ctrl C then I need to import this entire Json as a dashboard that's the beauty of because all these goods are templated nothing there will be no error so I'll come here I'll import this now instead I can you know simply import a Json also or I can simply paste this Json like this okay I'll do a load of the stack would already present in my uh URL I'll just give a different name I'll change this unique identifier ID and then they'll simply import into my training folder see now the same dashboard has been imported again onto different folder with different name with different ID so this is the second way of importing a dashboard from a Json which is again a very important thing to understand and how it can be imported the third and the last important thing which is very every developer will resist to do that because creating a dashboard from scratch is not a easy task but still how you can do it you can simply click on this you can actually import a panel which is being already created on some other types or you can simply add a visualization now adding a visualization as I told you you can simply take any query like for that matter I'm taking this query okay with my panel yeah this is the panel and I'll run this I'll get some data the inside time series I want to check it in bar chart okay I can do like this I can do Gorge also or simply suppose not like this uh whatever it makes sense let me what was this value run and let me take bar chart or maybe let me take a let's convert now again simply click you give some meaningful name test
Info
Channel: Bhoopesh Sharma
Views: 23,134
Rating: undefined out of 5
Keywords: dashboard, dashboards, grafana, grafana dashboard, grafana dashboard creation, grafana prometheus, grafana prometheus dashboard, grafana prometheus dashboard tutorial, grafana tutorial, grafana tutorial for beginners, learn grafana, prometheus, prometheus grafana, prometheus monitoring, prometheus monitoring demo, prometheus monitoring tool, prometheus monitoring tutorial, prometheus monitoring with grafana, step by step
Id: rt55FcSyl4o
Channel Id: undefined
Length: 22min 24sec (1344 seconds)
Published: Wed Jul 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.