Lewati ke konten utama
diskon 50% semua paket, waktu terbatas. Mulai dari $2.48/mo
Prometheus

Prometheus

Prometheus adalah standar pemantauan time-series. Metrik berbasis pull, kueri PromQL, aturan peringatan, dan penemuan native Kubernetes. Lulus CNCF, digunakan di SoundCloud (tempat pembuatannya), DigitalOcean, dan 80% deployment Kubernetes.

Sekilas

64.7k

Bintang GitHub

27

Tampilan halaman

Lisensi Apache-2.0 Versi 3.13.2 OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4,IPV6

Akses

  • Buka https://<SERVER_IP>:9090 di browser Anda.
  • Sertifikat ini ditandatangani sendiri, jadi browser Anda akan menampilkan peringatan sertifikat.
  • Halaman target Prometheus tersedia di https://<SERVER_IP>:9090/targets.
  • Metrik tersedia di https://<SERVER_IP>:9090/metrics.

Masuk

Prometheus dilindungi dengan HTTP Basic Authentication.

  • Nama pengguna: admin
  • Password: disimpan di /root/.prometheus-credentials

Autentikasi yang sama melindungi UI web, API, dan endpoint /metrics .

File dan Direktori Penting

  • Konfigurasi Prometheus: /etc/prometheus/prometheus.yml
  • Konfigurasi web/TLS/auth: /etc/prometheus/web-config.yml
  • Sertifikat TLS: /etc/prometheus/tls/
  • Data Prometheus: /var/lib/prometheus
  • Textfile Collector Node Exporter: /var/lib/node_exporter/textfile_collector
  • Kredensial: /root/.prometheus-credentials
  • Binary Prometheus: /usr/local/bin/prometheus
  • Promtool: /usr/local/bin/promtool
  • Binary Node Exporter: /usr/local/bin/node_exporter
  • Layanan Prometheus: /etc/systemd/system/prometheus.service
  • Layanan Node Exporter: /etc/systemd/system/node_exporter.service

Manajemen Layanan

Periksa Prometheus:

systemctl status prometheus

Mulai ulang Prometheus:

systemctl restart prometheus

Lihat log Prometheus:

journalctl -u prometheus -f

Periksa Node Exporter:

systemctl status node_exporter

Mulai ulang Node Exporter:

systemctl restart node_exporter

Lihat log Node Exporter:

journalctl -u node_exporter -f

Menambahkan Target

Sunting /etc/prometheus/prometheus.yml:

vim /etc/prometheus/prometheus.yml

Validasi konfigurasi:

promtool check config /etc/prometheus/prometheus.yml

Muat ulang Prometheus:

curl -sS --cacert /etc/prometheus/tls/prometheus.crt \
  -u admin:<PASSWORD> \
  -X POST https://localhost:9090/-/reload

Retensi

Prometheus dikonfigurasi dengan:

  • Waktu retensi: 30d
  • Ukuran penyimpanan maksimum: 10GB

Batas mana pun yang tercapai lebih dulu akan diterapkan.

Catatan

  • Grafana dan Alertmanager tidak terpasang. Keduanya dapat ditambahkan secara terpisah dan dihubungkan ke instance Prometheus ini.
  • Metrik disimpan hingga 30 hari atau 10 GB, batas mana pun yang tercapai lebih dulu.
  • Metrik host kustom dapat ditambahkan sebagai file .prom di: /var/lib/node_exporter/textfile_collector

Lebih banyak di Monitoring

Aplikasi terkait.

Deploy Prometheus sekarang. Mulai $2,48/bln.