Prometheus错误:无法加载配置。找到了多个抓取配置

时间:2020-05-18 21:31:17

标签: prometheus bosh

正如标题所述,我遇到了一个普罗米修斯异常,无法弄清楚如何解决它。

我们像这样使用BOSH部署:

bosh -d prometheus deploy -n prometheus.yml \
-o prometheus-boshrelease/manifests/operators/monitor-concourse.yml \
-o prometheus-boshrelease/manifests/operators/monitor-bosh.yml \
...

然后我们像这样进行清单更新:

- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
  job_name: concourse
  scrape_interval: 2m
  scrape_timeout: 1m
  static_configs:
    - targets:
      - 192.168.123.123:9391

在部署过程中,我们收到一个错误,提示prometheus2实例未运行。在prometheus.stderr.log中,我找到了错误消息:

找到了多个作业名称为“ concourse \”的抓取配置

我怎样才能让波什和博茨瓦纳出口商一起工作?这和我的清单修改有关系吗?寻找任何想法,谢谢!

1 个答案:

答案 0 :(得分:0)

您已经通过应用操作文件monitor-bosh.yml添加了此抓取配置。 https://github.com/bosh-prometheus/prometheus-boshrelease/blob/master/manifests/operators/monitor-bosh.yml#L199-L219

这可以自动发现您的大厅部署(如果bosh也部署了大厅)。

如果您不想使用自动发现,而是静态配置您的终端端点(虽然我不建议这样做),则必须首先从部署中删除我链接的部分。 可以使用这样的ops文件(未经测试)完成此操作:

- type: remove
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/job_name=concourse?

必须先应用它,然后才能应用更改。