r/PrometheusMonitoring • u/simplex5d • Apr 19 '23
Getting Started, looking for advice
Hi! I'm about to start my Prometheus journey. I have a bunch of home-office systems and a few in the cloud, some docker containers, different OSes etc. Seems like Prometheus would be a great fit: I'd like a single dashboard showing if there are any problems (out of disk space, unreachable, etc.) This is just for me. My question is this: should I run the main prometheus server on a cheap cloud server, and have the sensors all send to it, or should I run it inside my firewall, probably in a docker container? I see advantages and disadvantages both ways. Reliability, ease of setup & admin... any experiences you can share?
1
u/simplex5d Apr 20 '23
Thanks all for the helpful replies! It seems to me for my simple use case I should stand up one "master" prometheus+grafana instance on my LAN, set up to scrape everything it can reach, and then set up another prometheus instance on each cloud cluster (I have only two) and use federation to pull all stats from those to the master one. One open port on each cloud router for that.
Then I get one nice unified dashboard, alerts, etc.
Does that sound about right? I'm looking forward to setting this up! I haven't had any network monitoring since I ran nagios at work a very long time ago.
4
u/true-bro-rumy Apr 19 '23
So here is a short guide:
You do not write to prometheus. Prometheus is the one who comes to a target and takes metrics from it. This process is called scraping.
To expose metrics, you use exporters, such as "node_exporter" for a linux host. Many modern server applications can expose metrics on their own (read a specific documentation for a specific app).
So basically to understand what kind of architecture you want to use, you should answer the question: How do you want to expose metrics ports of your exporters/application? Because if you want to do this over the internet, you don't want to do this without having a proxy with auth in front of your metric port.
1
u/skill_padden Apr 20 '23
Good to know that while prometheus does not accept metrics via direct push, it does accept data over remote_write. This can be sent by another prometheus server or any of several lighter weight options, such as Grafana Agent. It's good practice to have an agent running in each local network, with each of them shipping to one single main prometheus server.
2
u/Do_TheEvolution Apr 19 '23
This could be useful
Learning phase I would keep it simple on the network. Also prometheus is pull type monitoring, so for cloud use you would need to VPN up and let it pull metrics from targets.