1

我正在尝试使用 prometheus 和 blackbox exporter 来监控某些东西。这是我的 prometheus.yml 文件。这是我得到的错误: couldn't load configuration (--config.file=\"/etc/prometheus/prometheus.yml\"): parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 9: mapping values are not allowed in this context

global:
 scrape_interval:     15s
 evaluation_interval: 15s
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
  - job_name: blackbox
          metrics_path:
          params:
            module: [http_2xx]
     static_configs:
            - targets:
              - https://www.robustperception.io/
              - http://prometheus.io/blog
              - http://yourdomain/usage-api/health
              - http://yourdomain/google-apm/health
              - https://google.com
              - https://www.telegraph.co.uk
          relabel_configs:
            - source_labels: [__address__]
            target_label: __param_target
            - source_labels: [__param_target]
4

1 回答 1

0

您的黑盒作业部分中有额外的空间。应该是这样的->

 - job_name: blackbox
   metrics_path: <metrics_path>
   params:
      module: [http_prometheus]
   ....
于 2020-06-17T21:44:32.513 回答