1

URL:localhost:15672/api/queues?columns=name,messages

结果:localhost:15672/api/queues%3Fcolumns=name,messages

普罗米修斯“?” 被编码为“%3F”,因此请求失败

你能写出结果吗?

    static_configs:
  - targets: ['localhost:15672']
metrics_path: '/api/queues?columns=name,messages'
4

2 回答 2

1

您必须使用scrape configparams的配置。

# Optional HTTP URL parameters.
params:
  [ <string>: [<string>, ...] ]

在你的情况下:

static_configs:
- targets: ['localhost:15672']
  metrics_path: '/api/queues'
  params:
     columns:'name,messages'
于 2020-03-30T18:59:07.200 回答
0

这应该更适合您:

- job_name: samplejob
  metrics_path: /api/queues
  params:
    columns: [name,messages]
  static_configs:
    - targets:
      - localhost:15672

文档和示例可以在这里找到:https ://prometheus.io/docs/guides/multi-target-exporter/#querying-multi-target-exporters-with-prometheus

于 2021-10-09T16:29:06.913 回答