【发布时间】:2020-09-23 15:17:54
【问题描述】:
我的 prometheus.yml 配置文件中static_configs 中的一个目标通过基本身份验证进行保护。因此,Prometheus 目标页面中始终针对该目标显示描述“连接被拒绝”的错误。
我研究了如何设置 prometheus 以在尝试抓取特定目标但找不到任何解决方案时提供安全凭据。我发现如何在文档的scrape_config 部分进行设置。这对我不起作用,因为我还有其他不受basic_auth 保护的目标。
请帮我解决这个挑战。
关于我的挑战,这是我的.yml 配置的一部分。
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
scrape_timeout: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:5000']
labels:
service: 'Auth'
- targets: ['localhost:5090']
labels:
service: 'Approval'
- targets: ['localhost:6211']
labels:
service: 'Credit Assessment'
- targets: ['localhost:6090']
labels:
service: 'Sweep'
- targets: ['localhost:6500']
labels:
【问题讨论】:
标签: monitoring prometheus