有人可以帮助我需要在 prometheus.yml 中添加什么配置来抓取像这样的 URLhttps://www2.abc.abc.com/servlet/metrics/吗?
我能够抓取常规节点导出器,但我们正在使用自定义指标构建一些东西。
我当前的配置文件如下所示:
global:
scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
- job_name: 'node_exporter_metrics'
scrape_interval: 5s
static_configs:
- targets: ['mockapi:9100']
Run Code Online (Sandbox Code Playgroud)
我需要添加一个新的工作 https://www2.abc.abc.com/servlet/metrics/
到目前为止,我的所有指标都在 http 上,但这个指标在 https 上。
添加一个配置自定义指标路径和方案的新作业。
它看起来像这样:
- job_name: new-job
scrape_interval: 5s
static_configs:
- targets: ['www2.abc.abc.com:443']
metrics_path: /servlet/metrics/
scheme: https
Run Code Online (Sandbox Code Playgroud)
端口 443 是 HTTPS 端口,scheme: https确保使用 HTTPS 协议并metrics_path通过指标处理程序指向您的自定义路径。
| 归档时间: |
|
| 查看次数: |
2710 次 |
| 最近记录: |