Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metric path not allowing a format like /metrics?&b1234 #5488

Closed
samanta1983 opened this Issue Apr 19, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@samanta1983
Copy link

samanta1983 commented Apr 19, 2019

Hello All,

We are trying to scrape targets using urls like following:

http://example.com:1234/service/metrics?&b1234

sample config:

- job_name: test-1
    metrics_path: /service/metrics?&b1234
    scheme: http
    static_configs:
    - targets:
      - example.com:1234

Here example.com is a VIP url which load balances across multiple JVMs. In order to connect to a specific JVM, an affinity url is constructed using "&b1234". The load balancer uses this to identify which JVM to connect.
However, Prometheus converts "?" to "%3F" while scraping and as a result gets 404.
Can you help us in identifying a solution for this. I tried using params, but it needs a key, value structure.

Note: Due to security reasons, we cannot directly connect to the individual JVM ports.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Apr 19, 2019

AFAICT your only option is using the params option which should generate http://example.com:1234/service/metrics?b1234=. There's no way to get rid of the trailing equal sign.

- job_name: test-1
    metrics_path: /service/metrics
    scheme: http
    params:
      b1234: []
    static_configs:
    - targets:
      - example.com:1234

I'm closing it for now. If you have further questions, please use our user mailing list, which you can also search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.