如何在promtheus.yml文件中解决此错误
面对promtheus.yml文件中的错误
“错误加载config(-config.file =/etc/prometheus/prometheus/prometheus.yml)” file =/etc/etc/prometheus/prometheus/prometheus.yml err =”解析yaml file/etc/prometheus/prometheus/prometheus.yml:yaml:yaml:yaml :第7行7字段静态config在类型config.scrapeconfig
中找不到
这是我的prometheus.yml文件
global:
scrape_interval: 5s
external_labels:
monitor: 'devopsage-monitor'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090'] # your server ip
- job_name: 'node-exporter'
static_configs:
- targets: ['localhost:9100'] # your server ip
Facing error in promtheus.yml file
"Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 7 field static config not found in type config.scrapeconfig
this is my prometheus.yml file
global:
scrape_interval: 5s
external_labels:
monitor: 'devopsage-monitor'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090'] # your server ip
- job_name: 'node-exporter'
static_configs:
- targets: ['localhost:9100'] # your server ip
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用此配置来解决此问题。
You can try this configuration to solve this problem.