toantd1202 / Prometheus_new

0 stars 0 forks source link

Base auth for prom #15

Open toantd1202 opened 4 years ago

toantd1202 commented 4 years ago

Phần này, em sử dụng nginx server chạy trên localhost:12321, và tất cả các metrics được đặt tại endpoint:

http://localhost:12321/prometheus/metrics

Sử dụng htpasswd để thiết lập username/password, ở đây admin làm username.

htpasswd -c /etc/nginx/.htpasswd admin

Tạo file nginx.conf để thiết lập cấu hình cho nginx server:

Cấu hình cho prome khởi chạy đằng sau proxy nginx: Screenshot from 2020-08-11 01-00-02

Đến đây, em test thử, thì vẫn chưa được:

prom vẫn chưa trả về metrics.

Screenshot from 2020-08-11 00-43-14

trong khi container prom của em vẫn hoạt động:

toantd1202 commented 4 years ago

cấu hình thì cũng không có gì thay đổi nhiều:

Note: sau khi đặt lại cấu hình nhớ restart nginx server: sudo systemctl restart nginx

Kết quả sau đó:

Screenshot from 2020-08-11 09-25-27

Bước đầu thiết lập tính năng xác thực cho prom.

toantd1202 commented 4 years ago

Screenshot from 2020-08-18 23-25-47 Screenshot from 2020-08-18 23-50-31

toantd1202 commented 4 years ago