Server Monitoring // Prometheus and Grafana Tutorial

Sdílet
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

Komentáře • 302

  • @christianlempa
    @christianlempa  Před 2 lety +58

    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!

    • @giftcp82
      @giftcp82 Před 2 lety +1

      why. is there any advantage to doing this or were there challenges with the first configuration.

    • @Trains-With-Shane
      @Trains-With-Shane Před 2 lety +1

      @@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.

    • @AbdulRahmanKayaliIbnMukhless
      @AbdulRahmanKayaliIbnMukhless Před 2 lety +1

      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?

    • @mridulranjan1069
      @mridulranjan1069 Před 2 lety +2

      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!

    • @mehammered
      @mehammered Před rokem

      The exporters folder seems to be missing also.
      Edit: Its in the dir is the prometheus folder not within it.

  • @xx482
    @xx482 Před 2 lety +31

    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

  • @cyberlord64
    @cyberlord64 Před 2 lety +72

    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

    • @adeelhashmi145
      @adeelhashmi145 Před rokem +3

      wait what? invaluable?

    • @bradleydiggs
      @bradleydiggs Před rokem +5

      @@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"

    • @user-se5xg3vz8p
      @user-se5xg3vz8p Před 11 měsíci

      @@adeelhashmi145 priceless

  • @wildflowers465
    @wildflowers465 Před rokem +1

    Hey Christian, another amazing video! I set this up in my home lab, and it works great.

  • @Psyt0s
    @Psyt0s Před rokem +21

    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!!

  • @tirushv9681
    @tirushv9681 Před 2 lety +4

    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

  • @Flako-dd
    @Flako-dd Před 2 lety +2

    Awesome man, a youtube guide that doesn't start with notepad on windows, but immediately gives you the github repo. Love it, great guide!

  • @processwire-rocks
    @processwire-rocks Před rokem

    Great video and super helpful as always! Thx for all your great content!

  • @renobodyrenobody
    @renobodyrenobody Před rokem

    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!

  • @itx777
    @itx777 Před 4 měsíci

    Thanks Christian for all your videos, they are very informative!

  • @0917hubing
    @0917hubing Před rokem +1

    今天边学习,边自己服务器配置了监视系统,谢谢Christian Lempa。

  • @RichardExists
    @RichardExists Před 2 lety +1

    Nice walkthrough man, very robust! Funny, I just did a small lab about these last night! So awesome!

  • @kalingsrajan4017
    @kalingsrajan4017 Před 2 lety

    Good explanation and got some new in this tut. Thanks for your great work.

  • @VincentBlouin
    @VincentBlouin Před 11 měsíci

    You've been an essential piece of the puzzle in setting this up.

  • @samme4life
    @samme4life Před 8 měsíci

    Quite informational video. Thank you for sharing your knowledge

  • @IgorKuts
    @IgorKuts Před 6 měsíci

    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.

  • @tyu3456
    @tyu3456 Před 2 lety

    Amazing. Thanks so much for this excellent walkthrough

  • @huplim
    @huplim Před 2 lety

    Just recently stumbled upon your channel and just needed to tell you your videos are awesome.
    Subscribed!

  • @Bradenxd12
    @Bradenxd12 Před 2 lety +1

    Such a great video! I've been developing a Grafana plugin at work and there is large void in high quality Grafana content.

  • @neuralnetdev
    @neuralnetdev Před rokem +5

    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)

  • @imanshirkhodaee1704
    @imanshirkhodaee1704 Před 8 měsíci

    All 24 minutes was useful and informative

  • @JacquesvanWyk
    @JacquesvanWyk Před rokem

    great video. I have been looking for months for a solution like this.

  • @JCtheMusicMan_
    @JCtheMusicMan_ Před 2 lety

    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!

  • @qoutwest
    @qoutwest Před 2 lety

    Great video! Going to try and set this up now that I have my Proxmox server up and running

    • @christianlempa
      @christianlempa  Před 2 lety +1

      Awesome! I'm currently working on getting this running on proxmox as well 😁

    • @keyshine5769
      @keyshine5769 Před 2 lety

      @@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!! 😭😍

    • @christianlempa
      @christianlempa  Před 2 lety

      @@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 😁

  • @md.mainuddin8211
    @md.mainuddin8211 Před 4 měsíci

    Thanks a lot for sharing with us

  • @cezwitsteez
    @cezwitsteez Před 2 lety

    thanks for this tutorial man, super helpful!

  • @UltimateKeyboardHero
    @UltimateKeyboardHero Před 2 lety

    I love your two recommended dashboards! was using statefulset daemonset metrics board before, but that's so bad compared to the node exporter full!

  • @ulrichbeutenmuller8101

    Awesome. Will put this on my test lab asap.

  • @locosporasturias
    @locosporasturias Před 2 lety

    Amazing, thank you very much for your time

  • @gaifut
    @gaifut Před měsícem

    Thank you for this detailed explanation.

  • @hikmatullah9463
    @hikmatullah9463 Před 6 měsíci

    It's was a nice video about Prometheus and grafana

  • @chrisumali9841
    @chrisumali9841 Před 2 lety

    Thanks for the demo and info, have a great day

    • @christianlempa
      @christianlempa  Před 2 lety

      You're welcome! :)

    • @chrisumali9841
      @chrisumali9841 Před 2 lety

      @@christianlempa which extension did you use for visual studio code to enable ssh editing on the server? Remote ssh by Microsoft? Thank you

  • @hareeshab9752
    @hareeshab9752 Před rokem

    Great video, it help us to understand very easily. Nice work.
    Always waiting for your new videos to upgrade ourself

  • @R_Mahesh5
    @R_Mahesh5 Před rokem

    Very useful, thanks a ton!

  • @averagedev7768
    @averagedev7768 Před 2 lety +2

    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

    • @christianlempa
      @christianlempa  Před 2 lety +1

      Nice, yeah cockpit is pretty cool, I also use it sometimes ;)

    • @martinlortie
      @martinlortie Před 2 lety

      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.

  • @leboncoinyca4704
    @leboncoinyca4704 Před 7 měsíci

    Great video as usual. Thanks !

  • @TheLichKng64
    @TheLichKng64 Před 4 měsíci

    thank you so much! your videos and content are super useful!

  • @Dravig
    @Dravig Před rokem

    Great job! Thank you!

  • @DigitEgal
    @DigitEgal Před 2 lety +1

    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.

    • @christianlempa
      @christianlempa  Před 2 lety

      Thank you so much! Great to hear that all the small tweaks help you to get a better experience 😁

  • @FrederickAlvarez_
    @FrederickAlvarez_ Před 2 lety

    I love your content, you the teacher I never had

  • @soukainaboualy912
    @soukainaboualy912 Před 3 měsíci

    Thank you so much, it's so understandable nd clear

  • @raoufgeorgemdimegh2781

    thank you for this amazing video very helpful 👍🏻

  • @Lucas-gp6xn
    @Lucas-gp6xn Před 2 lety

    Beautiful Tutorial, thanks!!!!

  • @sammanakkuon8581
    @sammanakkuon8581 Před 7 měsíci

    Thank you for sharing

  • @George-zm4iu
    @George-zm4iu Před 2 lety

    How have i only just seen your channel now! Awesome video, i enjoyed your ad too lol.
    Sub gained :)

    • @christianlempa
      @christianlempa  Před 2 lety

      Awesome, nice to hear you're liking the content 😁

  • @packetattack-netsec
    @packetattack-netsec Před rokem +2

    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.

    • @neuralnetdev
      @neuralnetdev Před rokem +2

      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.

  • @scholziallvideo
    @scholziallvideo Před rokem

    hi,
    perfect video.
    i use prtg monitoring for the servers etc.
    Primary windows servers and vcenter hyper-v etc.

  • @benjaminshtark5977
    @benjaminshtark5977 Před rokem

    simply amazing stuff!!
    I really like 2 things about your videos
    1. amazing and professional explanations
    2. your German accent :DD

  • @pavelmishin3211
    @pavelmishin3211 Před rokem

    Very useful tutorial, thank you!

  • @zb3485
    @zb3485 Před rokem

    the channel is incredible, thanks!

  • @ryanbell85
    @ryanbell85 Před rokem +7

    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

  • @Draugr793
    @Draugr793 Před 2 lety

    Wow. Thank you very much. That was great.

  • @AiJogja
    @AiJogja Před 7 měsíci

    this is the great video, very helpfull. thanks man.

  • @hanpoyang
    @hanpoyang Před rokem

    Thanks for sharing, that's helpful.

  • @robertoiglesias5427
    @robertoiglesias5427 Před 6 měsíci

    Thank you bro, 2 years old but still extremely useful.

  • @alemran7480
    @alemran7480 Před rokem

    Thank you so mush ❤ Fantastic tutorial 👏

  • @jacobcrisman6834
    @jacobcrisman6834 Před rokem +1

    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

  • @nguyendhn
    @nguyendhn Před 2 lety

    Thank you so much! It's so easy to understand and keep following.

  • @kanstantsinkatlinski8502

    Dude! It helped a lot, many thanks!

  • @edisvila
    @edisvila Před 2 lety +10

    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

    • @christianlempa
      @christianlempa  Před 2 lety +6

      Such a great idea! I'm planning a new video about that, but that's a bit down my list for next year.

    • @edisvila
      @edisvila Před 2 lety +3

      @@christianlempa Looking forward to it :)

  • @sangtengkorak1954
    @sangtengkorak1954 Před 2 lety

    + Good video with deep thoughts as usual

  • @Rfeliz456
    @Rfeliz456 Před rokem

    Great Explanation sir, you have earned another follower :)

  • @fabricioncosta
    @fabricioncosta Před 6 měsíci

    excelente material!

  • @sarmadahsan869
    @sarmadahsan869 Před rokem

    amazing, Help me a lot. Thanks

  • @1Chitus
    @1Chitus Před rokem +1

    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 ?

  • @YouTubers-rj9xv
    @YouTubers-rj9xv Před 2 lety +1

    Bro excellent teaching

  • @user-tl4nq3ib5g
    @user-tl4nq3ib5g Před rokem

    thank you for your work

  • @paulsalele3844
    @paulsalele3844 Před 2 lety

    Awesome content!!

  • @lchig0
    @lchig0 Před 5 měsíci

    Great video akhi

  • @haoxuefeng9336
    @haoxuefeng9336 Před 2 lety +1

    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?

    • @christianlempa
      @christianlempa  Před 2 lety +1

      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!

  • @NemesisKo1
    @NemesisKo1 Před 2 lety

    awesome

  • @malyyigor34
    @malyyigor34 Před 4 měsíci

    nice, thank you

  • @hetzandreas3442
    @hetzandreas3442 Před 2 lety

    2021 and you show grafana ? Thats "excellent"

  • @daiben2004
    @daiben2004 Před 6 měsíci

    Nice Explanation, It will be more beneficial if you set up Alert manager, How we can do?

  • @djKenpLan09
    @djKenpLan09 Před 7 měsíci

    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!

  • @mohammedsnoussi8782
    @mohammedsnoussi8782 Před rokem

    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.

  • @none_the_less
    @none_the_less Před rokem

    Well done sir.

  • @hcrp8840
    @hcrp8840 Před 2 lety

    thank you bro very awesome thank you again thanks a lot

  • @christophercarr4207
    @christophercarr4207 Před rokem

    thank you

  • @Tyrun101
    @Tyrun101 Před 8 měsíci

    Thanks!

  • @mohamedhaneef6379
    @mohamedhaneef6379 Před rokem +1

    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:)

  • @zag1964
    @zag1964 Před 2 lety

    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?

    • @christianlempa
      @christianlempa  Před 2 lety

      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.

  • @mohammad-aminebanaei886

    awesome thank you

  • @vladx71
    @vladx71 Před rokem

    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 :)

    • @christianlempa
      @christianlempa  Před rokem

      I haven't looked into Graylog, yet :/ But I'm planning more monitoring videos in the next year, there is definately an update needed!

  • @joshuaplouffe1439
    @joshuaplouffe1439 Před 2 lety +1

    Could you do a video on how to set up alertmanager on top of this setup? Its a missing piece to this AMAZING tutorial!

    • @christianlempa
      @christianlempa  Před 2 lety

      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 ;)

  • @Zero-qs8uq
    @Zero-qs8uq Před rokem

    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!

  • @tbm8347
    @tbm8347 Před 2 lety

    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?

  • @alaahaider
    @alaahaider Před 2 lety +1

    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

    • @christianlempa
      @christianlempa  Před 2 lety +2

      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.

    • @alaahaider
      @alaahaider Před 2 lety +1

      @@christianlempa thank you so much. You are awesome and your videos are awesome 😎

  • @huseyinbarin1653
    @huseyinbarin1653 Před 2 lety

    awesome!!

  • @samdhillon8325
    @samdhillon8325 Před 10 měsíci

    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 :-)

  • @shetuamin
    @shetuamin Před 2 lety

    Great video. Please make a video for plex, pihole, grafana monitor.

  • @fadjarpradja
    @fadjarpradja Před 2 lety

    awesomee !, thanks

  • @conradtaylor29
    @conradtaylor29 Před měsícem

    Hey Christian, this was a fantastic video and I learned a ton. I was wondering, how did you setup Portainer?

    • @christianlempa
      @christianlempa  Před měsícem

      Thank you! I think there's a tutorial for portainer on my channel :)

    • @conradtaylor29
      @conradtaylor29 Před měsícem

      I just ended up adding Portainer to the docker-compose.yaml file and this appears to work.

  • @RameshSingh-oj7hq
    @RameshSingh-oj7hq Před rokem

    Thanks for making the video can you please let me know how Prometheus monitoring is different from Splunk monitoring

  • @cybersecurehacks
    @cybersecurehacks Před 2 lety

    Nice. I am gonna implement this tomorrow in my organization. Also is there a way to manage esxi storage from some 3rd party tool?

    • @christianlempa
      @christianlempa  Před 2 lety

      Awesome! Unfortunately I haven't worked with esxi storage lately.

  • @SravanKumar-bi9mw
    @SravanKumar-bi9mw Před rokem

    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.

  • @christianajeitoh6533
    @christianajeitoh6533 Před 2 měsíci

    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

    • @christianlempa
      @christianlempa  Před 2 měsíci

      you have to run node_exporter on all nodes as far as I know

  • @KrakPoT13
    @KrakPoT13 Před 9 měsíci

    I'm very new to this -- I see that both containers are separate now. How would I go about deploying them now?

  • @amsirajuddin
    @amsirajuddin Před 2 lety

    nice one!

  • @yurafinzi
    @yurafinzi Před rokem

    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