Prometheusmetrics_path 被编码

标签 prometheus prometheus-node-exporter

URL:localhost:15672/api/queues?columns=名称,消息

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

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

你能写出结果吗?

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

最佳答案

您必须使用scrape configparams配置.

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

就您而言:

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

关于Prometheusmetrics_path 被编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60935664/

相关文章:

go - 为什么我的普罗米修斯标签不显示?

docker - docker : Host networking vs hostnames 中的 Prometheus node_exporter

docker - 如何在已经存在的Docker容器上安装Prometheus节点导出器?

kubernetes - 从 GKE 1.15 更新到 1.16 时的 Prometheus (node_exporter) 问题

ruby-on-rails - Ruby on Rails : getting Prometheus metrics with Telegraf

automated-tests - Cypress.io 与 Prometheus 兼容吗?

Prometheus指标删除后不消失

influxdb - AppDynamics 可以与 Prometheus 后端一起使用吗?

prometheus - 如何使用 prometheus 和 node_exporter 获得服务器的整体正常运行时间

python - 用于 json 值的 Prometheus python 导出器