我正在尝试使用prometheus和黑盒导出器来监视某些内容。这是我的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]
黑盒作业部分中有多余的空格。应该是这样->
- job_name: blackbox
metrics_path: <metrics_path>
params:
module: [http_prometheus]
....