Monitoring Your Internet Connection With Prometheus And Grafana

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
a lot of the things we do these days relies on having an internet connection now in the early days you just pay for access to the internet and you want it alert if it went down but now you can purchase packages with different upload and download speed so it's not just about monitoring reliability but also consistency in other words I'm getting the service you're paying for or other times during the day when there are slow downs on dropouts now an interesting open source combination of monitoring tools that's available for free is Prometheus and Barna but how do you configure Prometheus and grafana to want to be your internet connection well you know that's something that you're interested in finding out and stick around and watch this video because that's what we'll be going over now because this video is specifically about monitoring your internet connection I'm going to assume that you already have Prometheus and grafana installed or you know how to set these up if not then I do have another video which shows you how to install and configure these in docker now Prometheus relies on exporters to be able to get its metrics and normally if I'm looking for an exporter I'll be looking for one on this web page here but if we scroll down scroll small scroll until we get to apis find one which is called speed test exporter and that's what I'm looking for to monitor the internet connection if I go to that actual web page though I'll just scroll up it says that repository has been archived on January the 3rd 2023 it's now on a read-only state and you can see it hasn't actually been updated since 2021 which isn't really a good thing I mean it doesn't necessarily mean it won't work it's just basically not being maintained and that's what I want it's something that's actually being me intend just in case there's updates that do actually result in the actual export are no longer working so have a look around and I came across this one here and I wouldn't interest me about this one is the fact that well was last updated June 29th so it's still being maintained never scroll down it does have multiple contributors which is usually good saying in which case this is the one we're going to use so if over two terminal session so I'm logged into the actual Docker platform here now I'm using Docker compose to actually run all this so I'm just going to edit the docker compose yaml file using Nano because this is already set up to run Prometheus grafana and various other exporters I don't have to put in things like a version number don't have to put in a Services block here I just need to go to the end of the file then what I'm going to do is just being paste in the details that I need so I've taken these from the actual GitHub web page for this exporter so we've got an image name here that we're going to be using to download and run I've got a container name to make it a bit easier to identify we're sticking to the default Port which is nine seven nine years and then for restarts well I do want this running all the time but if I'm going to be doing maintenance I don't want it to automatically start up if I manually stop the container so rather than having that set to always Etc unless stopped so we'll save that file and then what we can do is to actually start this up so I'm going to be using Docker compose up then Dash D so basically it's just going to run every container that's referenced in that yaml file unless it's already running and it's going to do that in the background so just hit return and then off it should go and start to actually download and the actual files that are needed and then they'll get this container up and running now the next thing to do is to configure Prometheus to actually use this exporter so for me I need to edit a file called prometheus.yml in a folder called Prometheus I'm just going to use Nano for that now this is obviously set up to run other jobs so I'm just going to go right to the end here and I'm going to paste in the new job specifically for this speed test exporter and what I've got here is just based on the actual example the get from the actual get a web page so we've got a job name for it then we've actually defined script interval now if we go right to the top of the page I've actually got a default script interval here of one minute now what we're doing here is to actually run tests against ear server out there on the internet and tomorrow a courtesy really that we don't want to be placing too much of a load on this actual server I mean we're getting access to this for free for instance but we've also got to take into account the fact that this is our actual own internet connection it's not just running a ping test for example to see if it's getting a response it's actually doing uploads and downloads to actually test what your actual connections like and if you do that too frequently well that's just going to impair your own internet connection so it doesn't really make sense to do this too often so what they've got in their example is a selling of one hour which seems quite reasonable actually so I'll stick to that but it's entirely up to you how often you want to run this then we've just got a script timeout of one minute which they've set which seems fine for me and then we've got a static config setting here which basically points to the actual exporter itself now in my case I'm running all of this on a Docker platform so for that reason I've got Prometheus running in a container and I've got this exporter running in a different container so I can't use localhost different entities they're all running on the same actual computer but there are different entities from the perspective of the networking IP addressing and so on so for that reason I'm using the IP address of the actual computer that's running all of this you could use fully qualified domain names if you like but I'm just keeping things simple so all I've got to point it to is the IP address of the computer and the actual Port that the actual export is listening to so I'm going to save that config now because I made a change to the configuration here we need to actually update Prometheus now you could actually reload the container but if you've actually set a configuration within Prometheus to actually load the config on the Fly then you can do it that way so that's what I'm doing here is to send a Reload command to the actual Prometheus itself and then what that will do is update the configuration now bear in mind I've now got this set to actually scrape every one hour so all I've updated the configuration here problem is it doesn't automatically take effect in that it's going to start counting down and then an hour later it's then going to actually start to script metrics so yeah I'm gonna have to wait a bit of time here well I've left this long enough and if I go too Prometheus in other words I connect to Port 9090 of that computer and then go to status and targets I've got a job here called speedtests Dash exporter so if I click on show more you can see that's showing a state of up so that's a good sign if I'm in Far URL for the actual exporter itself you can see there is some metrics actually now being collected so in other words it looks as though this is actually now working one thing I'll point out though is that if you are restricting access to the internet what this is doing is actually connecting to TCP Port 80801 some computer out there on the internet so that's something you need to bear in mind typically when you're using web browsers you're connecting to Port 80 or Port 443 for example but this is using it's zero it's zero so do make sure that you're allowing access to that but at least now we know that the exporter has been able to connect out to a server on the internet now login creates your own dashboard in grafana if you want there are actually people out there who are making these available for free and when it comes to this particular speed test exporter this is the one that the actual developer themselves is recommending so that's what we're going to be using to actually get a more visual representation of actually what's going on with our internet connection so to do that we'll click on the option copy ID to clipboard and then we'll connect over to grafana we'll select the menu option here and Anzac dashboards then click on the drop down menu new and select import then we'll paste in the actual ID that we copied click load you can change the name here if you want to tie up to you but you do have to select the actual data source for Prometheus here and then click on import and then what you then get is some pretty good information of actually what's going on with your internet connection now this has only been able to connect out once so far it's only connecting every one hour so at the moment there's not a great deal to see here in the graph but this is something you can keep an eye on to see if there's any dropouts or slowdowns for instance During certain times of the day these are things that you want to be looking out for so because that well really depends on your circumstances maybe during the peak hours you know you're sharing your internet connection with Neighbors in which case there's a big load on the internet connection for that provider and so it slows down on the other hand there might be something going on within your network maybe an actual device switch firewall who knows something actually might be slowing down that's okay so then looking at the graph to see what sort of time of day these occurred in having a look around on your actual devices to see if something's placing load on them well there is useful information as I say I mean we're getting details about download speed the upload speed ping and Jitter that you get and as I say you're not just getting that at a specific moment in time just by by looking at the actual dials here you're actually going to be able to Trend that over a period of time and that's what you really want when you're purchasing a service you want to know are you actually getting your money's worth now if you find this video to be useful then do consider subscribing to the channel and does that really mean a lot to me but it's also a good indicator to let me know how a video is like this are helpful to people such as yourselves that are watching in which case thank you on the other hand if you're not ready for that level of commitment then I'd really appreciate it if you could press the like button is that where that'll help you get the video out to other people that might find it useful as well
Info
Channel: Tech Tutorials - David McKone
Views: 5,068
Rating: undefined out of 5
Keywords: monitor internet speed over time, monitor internet traffic at home, monitor internet connection, monitor internet traffic, monitor internet speed, monitor internet connection stability, monitor internet traffic on home network, monitor internet speed continusouly, monitor internet stability, prometheus monitor internet connection, prometheus speedtest exporter, internet monitor, internet monitoring
Id: dpVW4aAkZdQ
Channel Id: undefined
Length: 11min 2sec (662 seconds)
Published: Mon Sep 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.