Prometheus

Cơ bản mình hiểu em nó như là trại tập trung / database chứa data từ các exporters thu thập về. Sau đó hỗ trợ việc query để hiển thị data lên Grafana.

Hiện tại version mới nhất của Prometheus là 2.37.0 . Well. Workstation đang sử dụng 2.36.2, upgrade thôi.

Install

  • Download và extract ra
  • Xong mv về /usr/local/bin sudo mv prometheus promtool /usr/local/bin/
  • Mv luôn libraries sudo mv consoles/ console_libraries/ /etc/prometheus/
  • Tạo file SystemD service unit
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/docs/introduction/overview/
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP \$MAINPID
ExecStart=/usr/local/bin/prometheus \
  --config.file=/etc/prometheus/prometheus.yml \
  --storage.tsdb.path=/var/lib/prometheus \
  --web.console.templates=/etc/prometheus/consoles \
  --web.console.libraries=/etc/prometheus/console_libraries \
  --web.listen-address=0.0.0.0:9090 \
  --web.external-url=

SyslogIdentifier=prometheus
Restart=always

[Install]
WantedBy=multi-user.target

Ah dĩ nhiên cũng cần tạo user cho em nó

sudo groupadd --system prometheus
sudo useradd -s /sbin/nologin --system -g prometheus prometheus

Pages: 1 2

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: