使用Prometheus scrape_config_files参数

问题描述 投票:0回答:1

以下是用于刮擦Sybase Monitoring实例端点的作业配置的消毒版本。

- job_name: sybase-job basic_auth: username: "user" password: "password" honor_timestamps: true scheme: https scrape_interval: 30s scrape_timeout: 30s metrics_path: "/prometheus/metrics?tls=false&port=13603&target=10.10.10.10:12311&entity=NPASEX.SYB_UK-DEV-01&entity_type=SYBASE" tls_config: insecure_skip_verify: true follow_redirects: true static_configs: - targets: ["10.10.10.10:12311"]
当Prometheus配置文件中定义时,在调用配置重新加载时会毫无问题地拾取。但是,如果在单独的文件中定义并使用scrape_config_files参数在主配置文件中引用

scrape_config_files: - /prom_config/dir/sybase/*.yml

full错误:

May 14 13:11:49 promhost1 prometheus[1033]: ts=2024-05-14T12:11:49.650Z caller=main.go:1255 level=error msg="Failed to apply configuration" err="\"/prom_config/dir/sybase/npasex.syb_ukdev-01.yml\": yaml: unmarshal errors:\n line 1: cannot unmarshal !!seq into config.ScrapeConfigs"

任何帮助都将不胜感激

请参见上文。 Scrape配置已在两种方法中都定义,并期望它应该始终如一。

this并未清楚地记录下来,但是每个文件都应具有最高级别的密钥:

database prometheus sybase
1个回答
0
投票

请参阅

抢劫单元测试输入
以获取示例。


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.