AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
[TOC] ## 基于文件的服务发现 - 基于文件的服务发现是最通用的方式 - Prometheus会定时从文件中读取最新的Target信息 ## 配置 prometheus.yml ``` scrape_configs: - job_name: node file_sd_configs: - files: - "target.json" ``` ## targets.json ``` [ { "labels": { "job": "node" }, "targets": [ "localhost:9100" ] } ] ``` ## 测试动态添加 targets.json ``` [ { "labels": { "job": "node" }, "targets": [ "localhost:9100" ] }, { "labels": { "job": "node1" }, "targets": [ "localhost:91002" ] } ] ``` 查看 `http://192.168.0.229:9090/targets` 可直接看到效果