initial commit
This commit is contained in:
100
cheatsheet.md
Normal file
100
cheatsheet.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# 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 <url> → Downloads file from internet
|
||||
tar -xvf <filename> → Unzips a .tar.gz file
|
||||
sudo useradd --no-create-home --shell /bin/false prometheus → Creates restricted user
|
||||
sudo mkdir <folder_path> → Creates a new folder as admin
|
||||
sudo chown user:group <folder_path> → Changes the owner of a folder
|
||||
sudo cp <file> <destination> → Copies a file to a new location
|
||||
|
||||
### systemd commands
|
||||
sudo systemctl daemon-reload → Reloads Linux after creating a new .service file
|
||||
sudo systemctl start <service> → Turns a service ON right now
|
||||
sudo systemctl enable <service> → Tells Linux to turn it on automatically after reboot
|
||||
sudo systemctl status <service> → 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]
|
||||
Reference in New Issue
Block a user