목록DevOps/Prometheus (2)
우노
들어가기 앞서, 해당 포스팅에선, Prometheus Config의 scrape_configs 설정 시 static_configs의 targets을 어떻게 설정해야하는지에 대해서 다뤄보겠습니다. Prometheus Config File 예제 코드 global: scrape_interval: 30s evaluation_interval: 30s scrape_timeout: 10s scrape_configs: - job_name: 'Test' static_configs: - targets: ['12.34.567.890:8086'] “http://12.34.567.890:8086/metrics”라는 경로에서 metrics를 scrape 해오고 싶다면, targets에는 “http:/..
들어가기 앞서, 해당 포스팅에선, K8S Deployment로 정의한 Prometheus Container를 기본 설정 파일 및 Basic Auth가 적용된 웹 설정 파일을 기반으로 실행하는 방법에 대해서 다뤄보겠습니다. 관련 리소스는 Terraform으로 관리하고 있기 때문에, HCL 코드를 기반으로 설명하겠습니다. Basic Auth에 사용할 비밀번호 해싱 python3-bcrypt를 사용해 Basic Auth에 사용할 비밀번호를 해싱합니다. import getpass import bcrypt password = getpass.getpass("password: ") hashed_password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt()) ..