Prometheus + Grafana - ์—ฐ๊ฒฐ

2023. 7. 31. 10:38ใ†๊ฐœ๋ฐœ/Monitoring

728x90
๋ฐ˜์‘ํ˜•
๐Ÿ’ก ์ค€๋น„๋ฌผ : ubuntu

์„ค์น˜

# Grafana ์„ค์น˜
wget <https://dl.grafana.com/oss/release/grafana_8.5.2_amd64.deb>
sudo dpkg -i grafana_8.5.2_amd64.deb
 
# Prometheus ์„ค์น˜
wget <https://github.com/prometheus/prometheus/releases/download/v2.35.0/prometheus-2.35.0.linux-amd64.tar.gz>
tar xvfz prometheus-2.35.0.linux-amd64.tar.gz
mv prometheus-2.35.0.linux-amd64.tar.gz prometheus

๋ชจ๋‹ˆํ„ฐ๋ง ๋Œ€์ƒ ์„ค์ •

RabbitMQ Plugin ํ™œ์„ฑํ™”

# rabbitmq_prometheus plugin ์„ ํ™œ์„ฑํ™”์‹œํ‚ค๋ฉฐ exporter ํฌํŠธ๋Š” 15692 ์ด๋‹ค
sudo rabbitmq-plugins list
sudo rabbitmq-plugins enable rabbitmq_prometheus

์„ค์ •

prometheus.yml ์„ค์ • ํŒŒ์ผ

  • ์›ํ•˜๋Š” ์„œ๋น„์Šค๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ ๋“ฑ๋ก, ํ•ด์ œ ๊ฐ€๋Šฅ
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"
 
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
 
    static_configs:
      - targets: ["localhost:9090"]

์‹คํ–‰

# Promeheus ์‹คํ–‰ ๋ช…๋ น์–ด
./prometheus/prometheus

# Grafana ์‹คํ–‰ ๋ช…๋ น์–ด
service grafana-server start

# ๋ฐฉํ™”๋ฒฝ ์˜คํ”ˆ
firewall-cmd --permanent --zone=public --add-port=3000/tcp
firewall-cmd --permanent --zone=public --add-port=9090/tcp
firewall-cmd --reload

์‹คํ–‰ ํ™”๋ฉด

Prometheus ํ™”๋ฉด
Grafana ์ดˆ๊ธฐ ID : admin / PW : admin

Grafana + Prometheus ์—ฐ๊ฒฐ

Add data source ํด๋ฆญ
Prometheus ํด๋ฆญ
์„ค์ • ์ •๋ณด

URL ๊ฐ’์— Prometheus URL ์ž‘์„ฑ ํ›„ Save & Test ํด๋ฆญ

728x90
๋ฐ˜์‘ํ˜•

'๊ฐœ๋ฐœ > Monitoring' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

Prometheus + Grafana - RabbitMQ ๊ตฌ์ถ•  (0) 2023.07.31
Prometheus + Grafana - Redis ๊ตฌ์ถ•  (0) 2023.07.31
Prometheus, Grafana - ์ด๋ก   (0) 2023.07.31