首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >prometheus未启动(未加载prometheus.yml文件)

prometheus未启动(未加载prometheus.yml文件)
EN

Stack Overflow用户
提问于 2021-05-13 12:51:12
回答 1查看 603关注 0票数 1

启动Prometheus时,我收到以下错误:

代码语言:javascript
复制
level=error ts=2021-05-13T04:42:39.652Z caller=main.go:355 msg="Error loading config (--config.file=prometheus.yml)" err="parsing YAML file prometheus.yml: yaml: line 36: did not find expected key"

我在试着把Blackbox Exporter集成到Prometheus。

这是我的prometheus.yml文件:

代码语言:javascript
复制
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any time-series scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'node_exporter'
    static_configs:
    - targets: ['localhost:9100']



  - job_name: 'blackbox_exporter'
     metrics_path: /probe
     params:
       module: [http_2xx]
     static_configs:
       - targets:
           - https://www.google.in
     relabel_configs:
       - source_labels: [__address__]
         target_label: __param_target
       - source_labels: [__param_target]
         target_label: instance
       - target_label: __address__
         replacement: localhost:9115
EN

回答 1

Stack Overflow用户

发布于 2021-08-08 03:59:55

我认为您可以运行此命令来检查配置

prometheus --config.file=your_config.yml

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67514027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档