Server Monitoring // Prometheus and Grafana Tutorial
Vložit
- čas přidán 18. 06. 2024
- Server Monitoring with Prometheus and Grafana setup in Docker and Portainer. I explain the difference between metrics and logging and how Prometheus can monitor all your server metrics and use Grafana to visualize them.
Teleport-*: goteleport.com/thedigitallife
Related Videos/Links
• My new Proxmox Monitor...
________________
💜 Support me and become a Fan!
→ christianlempa.de/patreon
💬 Join our Community!
→ christianlempa.de/discord
________________
Read my Tech Documentation
christianlempa.de/docs
My Gear and Equipment-*
christianlempa.de/kit
________________
Timestamps:
00:00 - Introduction
01:08 - Why centralize monitoring
02:01 - Difference between logs and metrics
03:19 - What is Prometheus?
03:46 - Monitoring Architecture
05:12 - Deploy Prometheus and Grafana
10:03 - Configure Prometheus
13:21 - Third-Party Exporters
19:04 - Visualize data with Grafana
21:44 - Import Grafana Dashboards
________________
All links with "*" are and/or include affiliate links.
#Prometheus #Grafana #HomeLab
Please be aware: update to the Git Repo: github.com/xcad2k/boilerplates
I now separated the docker-compose files for Grafana and Prometheus in two separate folders!
why. is there any advantage to doing this or were there challenges with the first configuration.
@@giftcp82 In case you wanted to set them up standalone. Not a problem for somebody who's familiar with docker compose YAML files but for somebody just starting out it could get confusing having it all together. This way it narrows the focus and doesn't get everything potentially confused for the new user.
What is the difference between grafana/grafana and granfana/grafana-oss as your updated Git Repo refers to the latter while video refers to the former?
With time any updates like this will be harder to find in the Comments section. I was lucky I found just when I was wondering the video shows a combined docker-compose.yaml but the actual repo has them separated. Maybe update the main Description section with a dated update about the repo? You know, just like a code description update :-) Anyways, loved your video so far, the presentation. Great Job!
The exporters folder seems to be missing also.
Edit: Its in the dir is the prometheus folder not within it.
Before going to watch this video .. i really appreciate you for making this video .. i was struggling to learn the basics of Prometheus and grafana , you really helped me by putting this video.. Thx in advance
You're welcome!
Absolutely invaluable. I have gone through a few of your other videos as well, and everything is essentially easily digestible essential knowledge that would otherwise take me weeks to search and figure out on my own.
A huge plus is that the scripts and snippets provided actually work out of the box and everything is explained on an almost line by line basis.
Thank you for your amazing work
wait what? invaluable?
@@adeelhashmi145 It's weird that it means what it does (with the prefix in- that normally means the opposite), but it actually means "incredibly valuable" or "more valuable than valuable"
@@adeelhashmi145 priceless
Hey Christian, another amazing video! I set this up in my home lab, and it works great.
Man, I can't thank you enough!! all your videos are so easy to follow and actually understand what I'm doing!! You are awesome!!
Thank you so much :)
Happy to see this video particularly by "The Digital Life" Thanks sir cause i have seen many videos already but here we can get exact points to remember and its basically on point
So nice of you!
Awesome man, a youtube guide that doesn't start with notepad on windows, but immediately gives you the github repo. Love it, great guide!
Thank you so much! :)
Great video and super helpful as always! Thx for all your great content!
Thanks a lot. There is so much ressources, sometimes ununderstandable, it's difficult to find the information hidden in the noise. Your video is very very helpful. Thanks a lot!
Thanks Christian for all your videos, they are very informative!
今天边学习,边自己服务器配置了监视系统,谢谢Christian Lempa。
Nice walkthrough man, very robust! Funny, I just did a small lab about these last night! So awesome!
Cool! That's great to hear, thank you btw 😄
Good explanation and got some new in this tut. Thanks for your great work.
You've been an essential piece of the puzzle in setting this up.
Quite informational video. Thank you for sharing your knowledge
Thank you, Christian, for this ultra-high quality content. Learned a lot.
One thing tho, as for me, frequently i found it difficult to keep up with your pace.
Amazing. Thanks so much for this excellent walkthrough
Thank you! :)
Just recently stumbled upon your channel and just needed to tell you your videos are awesome.
Subscribed!
Thank you so much 😃
Such a great video! I've been developing a Grafana plugin at work and there is large void in high quality Grafana content.
Thank you so much! :)
for anyone who cannot get the prometheus or grafana container to start or they keep restarting (which is what happened to me), use the details below:
the volumes that your container accesses, run this command on them:
sudo chown -R 65534:65534 prometheus_example/
replace "prometheus_example" with the folder name that you provided to your volume(s)
65534 is the user and group id of the user/group that runs prometheus in the container.
for me, grafana also had permission issues in the logs of the container, too. the user and group id is 472 so you'd replace "65534" with "472" in the command above.
this issue occurs due to the user inside each container not having the correct permissions set. to my knowledge, most people here shouldn't have a problem if you followed the steps provided in the video correctly (which i didn't and i changed a few things with the volumes which is probably why i had this issue)
All 24 minutes was useful and informative
great video. I have been looking for months for a solution like this.
Thanks!
Get hit with a firehose of information! I have found it difficult to find quality tutorials on setting up a Grafana/Prometheus dashboard. Thanks for the wealth of resources and information!
Great video! Going to try and set this up now that I have my Proxmox server up and running
Awesome! I'm currently working on getting this running on proxmox as well 😁
@@christianlempa can you please make another full video when you got your proxmox up and running especially monitoring on LXC and etc. Im sure it will benefits alot of us!! 😭😍
@@keyshine5769 I guess that I will replace Proxmox at some day and focus more on Docker than LXC, there will be a big change in my Homelab next year 😁
Thanks a lot for sharing with us
thanks for this tutorial man, super helpful!
Glad you liked it!
I love your two recommended dashboards! was using statefulset daemonset metrics board before, but that's so bad compared to the node exporter full!
Awesome. Will put this on my test lab asap.
Thanks mate that sounds great!
Amazing, thank you very much for your time
Thank you for this detailed explanation.
Glad it was helpful!
It's was a nice video about Prometheus and grafana
Thanks for the demo and info, have a great day
You're welcome! :)
@@christianlempa which extension did you use for visual studio code to enable ssh editing on the server? Remote ssh by Microsoft? Thank you
Great video, it help us to understand very easily. Nice work.
Always waiting for your new videos to upgrade ourself
Thank you so much 😊
Very useful, thanks a ton!
Used cockpit for the last 2 years. I am very happy how it works. I have 7 servers in total i have to manage, and cockpit allows me to do just that by logging in on one single server adding others to there and watching there progress
Nice, yeah cockpit is pretty cool, I also use it sometimes ;)
Yep after turning on Cockpit this is exactly what I needed, but if you have more that one server with multiple instances of things then I can see Prometheus/Granafa shine.
Great video as usual. Thanks !
Thank you :)
thank you so much! your videos and content are super useful!
Glad you like them!
Great job! Thank you!
Wow, there is so much information in this Video i have to look that when im not tired :D But i can say already: Great Video mate!
Also i really like the "on camera writing" presentation uve done at 3:46-5:00 since i also learned a lot stuff from Networkchuck when he was doing that.
Atleast of course i can also see the small improvements (round corners) youve done at the cam-picture implementation and improvements in structure of your presentation.
Thank you so much! Great to hear that all the small tweaks help you to get a better experience 😁
I love your content, you the teacher I never had
Thank you so much :)
Thank you so much, it's so understandable nd clear
thank you for this amazing video very helpful 👍🏻
Thanks!
Beautiful Tutorial, thanks!!!!
Glad you liked it!
Thank you for sharing
How have i only just seen your channel now! Awesome video, i enjoyed your ad too lol.
Sub gained :)
Awesome, nice to hear you're liking the content 😁
Great tutorial, thank you! For any beginers out there. if your like me.. im trying to learn YML syntax... Linux and docker/portainer all at the same time.. Make sure your syntax in your prometheus.yml file is correct or else it wont start... I also had to identify the user: root in my stack editor for prometheus so that /etc/prometheus/prometheus.yml could be read.. im sure thats not secure.
the volumes that your container accesses, run this command on them:
sudo chown -R 65534:65534 prometheus_example/
replace "prometheus_example" with the folder name that you provided to your volume(s)
65534 is the user and group id of the user/group that runs prometheus in the container.
for me, grafana also had permission issues in the logs of the container, too. the user and group id is 472 so you'd replace "65534" with "472" in the command above.
hi,
perfect video.
i use prtg monitoring for the servers etc.
Primary windows servers and vcenter hyper-v etc.
simply amazing stuff!!
I really like 2 things about your videos
1. amazing and professional explanations
2. your German accent :DD
Thank you so much ☺️
Very useful tutorial, thank you!
Glad it was helpful!
the channel is incredible, thanks!
Thanks! You're welcome ;)
If you are using Ubuntu 22.04 and missing memory stats in grafana to monitor your docker containers, you'll need to change the version tag on cadvisor to: v0.44.1-test
Wow. Thank you very much. That was great.
Glad you enjoyed it!
this is the great video, very helpfull. thanks man.
Thanks
Thanks for sharing, that's helpful.
You’re welcome ☺️
Thank you bro, 2 years old but still extremely useful.
Thank you! Glad it's useful :)
Thank you so mush ❤ Fantastic tutorial 👏
Thank you so much ;)
I don't know why I try to go anywhere else when I need something installed in Docker. These videos always give more information than what is needed and everything is explained very well
Thank you! :)
Thank you so much! It's so easy to understand and keep following.
Dude! It helped a lot, many thanks!
Glad you liked it!
Great video as usual. There's just one thing though that I'm curious about and that is missing here. Notifications, for example when a service goes offline or when a specific event happens. I've seen that Grafana has an Alerts feature. I would really appreciate if you could make a video on just something like that for real life scenarios where a notification is useful
Such a great idea! I'm planning a new video about that, but that's a bit down my list for next year.
@@christianlempa Looking forward to it :)
+ Good video with deep thoughts as usual
Great Explanation sir, you have earned another follower :)
Welcome aboard!
excelente material!
thank you!
amazing, Help me a lot. Thanks
You're welcome!
Great video ! Just one tiny question: I intend to install Prometheus and Grafana on a RPI4 with 2GB of RAM. Is it enough to monitor about 5 containers and system metrics ?
Bro excellent teaching
Thank you mate! :)
thank you for your work
You're welcome :)
Awesome content!!
Glad you think so!
Great video akhi
Appreciated
thanks for the amazing tutorial! I've followed step by step and it worked on my local machine really cool. I'm curious to know if it can also monitoring remotely for a server? Any suggestions?
sure, the metrics exporter works over network protocols, so you can just enter an IP from a remote server. But make sure you're protecting and authenticating the connections!
awesome
nice, thank you
you're welcome :)
2021 and you show grafana ? Thats "excellent"
Nice Explanation, It will be more beneficial if you set up Alert manager, How we can do?
Me -> where can I find a good tutorial about Grafana and Prometheus?
Christian -> here you go!
:D
Thanks for all you do for the community!
Haha thanks 😊
Grafana dashboard layout displays all servers as IP addresses which is difficult for us to keep track of and we prefer to have it as a hostname display in the drop down. Any suggestions on how to get that done would be very helpful.
Well done sir.
Thx :)
thank you bro very awesome thank you again thanks a lot
Thank you! 😉
thank you
Thanks!
Many thanks for your support 🥰
Awesome!. I would like to work on a solution that would visualize various metrics from Palo Alto firewalls. I saw an exporter for Fortigate firewalls. Could you please suggest a way forward? How would I customize an integration option for Palo Alto firewalls? Thanks:)
Just came across your video. Great content. I do have one question. Is it possible to use the third-party exporters to fetch data from a hypervisor server while running in a docker inside a proxmox VM? I am running Proxmox in my home lab and have created a ubuntu server VM and I am running docker in the VM. While your tutorial works great for obtaining data from the host VM, I am more interested in the bare metal data running Proxmox. I am guessing if this is not possible I would need to run the docker in the ProxMox install directly on bare metal?
Great question, it is possible with the proxmox pve exporter: github.com/prometheus-pve/prometheus-pve-exporter
Might be a bit awkward to setup, but it's working on my end.
awesome thank you
You're welcome
It was great! There is something I'm trying to solve for a long time. For log collection I'm using Graylog, but I always facing issues when I try to implement this as Docker containers. Do you have a working Graylog compose file works in Portainer? I think you should consider a video on Graylog because it is a great and stable tool too and as you explained, logs are also important :)
I haven't looked into Graylog, yet :/ But I'm planning more monitoring videos in the next year, there is definately an update needed!
Could you do a video on how to set up alertmanager on top of this setup? Its a missing piece to this AMAZING tutorial!
Great suggestion, however I'm still working on so many projects. But at some point I'll make a video about Grafana Alerts maybe, we'll see ;)
Hey! Thanks for your video 😄
I have a question: There is a way to use Prometheus Cloud + Grafana Cloud without self-hosting it, if yes, then how? Thanks!
Is it possible to use expose instead of ports?
expose is only visible for linked containers and if both are on the same machine we could just link the services und protect prometheus using expose?
Great video, very useful. Thank you. Would it be possible to monitor different users login on grafana? Also would it be possible to have a summary of all servers on one page? So you can have a full overview of all your system? Thank you in advance
Grafana is just a visualizing engine, so for monitoring you'd need a system collect and aggregate the metrics and later use grafana to visualize it.
@@christianlempa thank you so much. You are awesome and your videos are awesome 😎
awesome!!
Thanks!
Nice tutorial as always!! Thank you Christian. I have tried to follow your steps to setup Prometheus but for some reason its is not reading the configuration file "prometheus.yml" from the host instead reading it from the prometheus container which i don't want. Can you please help me figure out what I may be missing here :-)
Great video. Please make a video for plex, pihole, grafana monitor.
Thanks! Hmm maybe pihole, Im not using plex :(
awesomee !, thanks
You're welcome!
Hey Christian, this was a fantastic video and I learned a ton. I was wondering, how did you setup Portainer?
Thank you! I think there's a tutorial for portainer on my channel :)
I just ended up adding Portainer to the docker-compose.yaml file and this appears to work.
Thanks for making the video can you please let me know how Prometheus monitoring is different from Splunk monitoring
Nice. I am gonna implement this tomorrow in my organization. Also is there a way to manage esxi storage from some 3rd party tool?
Awesome! Unfortunately I haven't worked with esxi storage lately.
very useful and Great video - I have done same process and dashboards got visible:-) But i got additional requirements to monitor ,Linux OS version. Which i am struggling and not showing with this ID 1860 ,Moreover, I am using node exporter +Prometheus data source. Can you please suggest on this.
Thanks very much for the content. It's very informative.
I have a question. If I have n nodes in my cluster. will node exporter give metrics for all of these node machines OR do I need to run node_exporter on each on these nodes
you have to run node_exporter on all nodes as far as I know
I'm very new to this -- I see that both containers are separate now. How would I go about deploying them now?
nice one!
Thx!
Hello Sir, i'm using container (LXC) to put database, can I install mysql_exporter in another container to monitor my database container? or does it have to be in my database container? thanks