# PROMETHEUS CHEAT SHEET Last Updated: 2026-05-11 14:44:00 --- ## Architecture Quick Reference Central server runs: - Prometheus → port 9090 - Grafana → port 3000 - Alertmanager → port 9093 Each remote server runs: - Node Exporter → port 9100 --- ## Bridge Reference | Prometheus concept | MERN/Express equivalent | |---|---| | prometheus.yml | Express config / .env | | scrape_interval | setInterval() | | Node Exporter | /health endpoint | | job_name | route group name | | labels | MongoDB document fields | | PromQL | MongoDB query language | | rate() | calculating speed from counter | | Grafana | React frontend | | Alertmanager | nodemailer | | systemd service | PM2 process | | promtool check | ESLint | | recording rule | database view | | federation | API gateway pattern | --- ## Essential Commands ### Install sequence wget → Downloads file from internet tar -xvf → Unzips a .tar.gz file sudo useradd --no-create-home --shell /bin/false prometheus → Creates restricted user sudo mkdir → Creates a new folder as admin sudo chown user:group → Changes the owner of a folder sudo cp → Copies a file to a new location ### systemd commands sudo systemctl daemon-reload → Reloads Linux after creating a new .service file sudo systemctl start → Turns a service ON right now sudo systemctl enable → Tells Linux to turn it on automatically after reboot sudo systemctl status → Checks if the service is running or crashed ### Validation [Empty] ### Debugging [Empty] --- ## prometheus.yml Skeleton ```yaml global: scrape_interval: 15s scrape_configs: - job_name: "example_job" static_configs: - targets: ["IP:PORT"] ``` ## alertmanager.yml Skeleton [Empty] ## Alert Rule Skeleton [Empty] ## Node Exporter systemd service [Empty] --- ## PromQL Quick Reference ### My 7 servers queries [Empty] ### Aggregation [Empty] --- ## Alert Rules For 7 Servers [Empty] --- ## Troubleshooting Decision Tree [Empty] --- ## Common Errors and Fixes [Empty]