Search code examples
prometheusprometheus-node-exporter

Prometheus metrics_path gets encoded


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

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

Prometheus the '?' gets encoded to '%3F' and therefore the request fails

Can you write the result?

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

Solution

  • You have to use the params configuration of the scrape config.

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

    In your case:

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