Hari Sekhon - Prometheus
January 21, 2025 ยท View on GitHub
Quick Prometheus Doc
See the Prometheus page in the HariSekhon/Knowledge-Base repo.
Prometheus Management Code
Initialize DevOps-Bash-tools and Template git submodules
make init
or
git submodule update --init --recursive
Prometheus
Install Prometheus
bash-tools/install/install_prometheus.sh
Sample Config from HariSekhon/Templates
At root of this repo:
Also available at:
HariSekhon/Templates - prometheus.yml
wget https://raw.githubusercontent.com/HariSekhon/Templates/refs/heads/master/prometheus.yml
Run Prometheus
Run Prometheus locally from root of repo against prometheus.yml:
bash-tools/monitoring/prometheus.sh
(automatically installs Prometheus if not already installed)
Or using Ansible (Linux only):
ansible-playbook -i localhost, ansible/prometheus/playbook.yml
Or to run it in Docker using docker-compose:
bash-tools/monitoring/prometheus_docker.sh
Open http://localhost:9090 URL to see Prometheus UI.
This script opens it using whatever the default browser on your Mac or Linux system is:
bash-tools/bin/urlopen.sh http://localhost:9090
Add exporters like the local Node Exporter the sample config is expecting using the next section.
Prometheus Exporters
Install Scripts
To install an exporter, run the relevant install script from the DevOps-Bash-tools submodule:
bash-tools/install/install_prometheus_*_exporter.sh
Install Node Exporter
bash-tools/install/install_prometheus_node_exporter.sh
Or using Ansible (Linux only):
ansible-playbook -i localhost, ansible/prometheus_node_exporter/playbook.yml
Run Node Exporter
Run Prometheus Node Exporter locally:
bash-tools/monitoring/prometheus_node_exporter.sh
(automatically installs Node Exporter if not already installed)
Systemd Unit Files
Systemd unit files for running Prometheus and Node Exporter are available under systemd.
More Core Repos
Knowledge
DevOps Code
Containerization
CI/CD
DBA - SQL
DevOps Reloaded
Templates
Misc
The rest of my original source repos are here.
Pre-built Docker images are available on my DockerHub.