普罗米修斯同时监听不同的端口

时间:2019-09-17 08:25:56

标签: prometheus wmi-service

我正在尝试同时监听2个端口: http://localhost:9182/metrics http://localhost:8080/prometheus 有人可以建议一个好方法吗?

1 个答案:

答案 0 :(得分:1)

您可以尝试以下Prometheus config file

scrape_configs:
  - job_name: job1
    static_configs:
      - targets:
        - localhost:9182
  - job_name: job2
    metrics_path: /prometheus
    static_configs:
      - targets:
        - localhost:8080

由于目标使用不同的度量标准路径(/metrics/prometheus),因此必须在单独的作业中定义它们。 /metrics是默认的度量标准路径,因此您不需要在job1中进行配置,但是需要将/prometheus配置为job2中的度量标准路径。