Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPrometheus gets 503 when scraping target behind haproxy #1741
Comments
This comment has been minimized.
This comment has been minimized.
|
Can you als curl the URL from the Prometheus node? |
This comment has been minimized.
This comment has been minimized.
|
There is a trap in how Prometheus constructs tree host header and how
HAProxy handles it. I suppose you are using ACLs for host-based routing?
Could you try `curl -v -H 'Host: pushgateway.corp.quobyte.com:80
http://pushgateway.corp.quobyte.com/` (note the port in the host header)?
The HTTP standard days they are equivalent, but because HAProxy doesn't
actually know the semantics of the host header you need to reflect that in
the ACL.
|
This comment has been minimized.
This comment has been minimized.
|
@matthiasr yes, this yields a 503. Adding an addtional URL with :80 in the Mesos label fixes it then:
Thank you very much for the hint! I hope this helps others if they run into the same issue. |
quolix
closed this
Jun 15, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
lock
bot
locked and limited conversation to collaborators
Mar 24, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
quolix commentedJun 15, 2016
What did you do?
What did you expect to see?
What did you see instead? Under which circumstances?
We run pushgateway on mesos, and put it behind haproxy. curl and chrome can fetch the URL http://pushgateway.corp.quobyte.com:80/metrics with no problems (that's the one displayed in /targets), but prometheus shows a "server returned HTTP status 503 Service Unavailable" in /targets.
I'll dig deeper when I find time, but I thought I'll document the issue for others.
Environment
System information:
Linux 3.10.0-327.18.2.el7.x86_64 x86_64
Prometheus version:
0.19.2 / 23ca13c
Prometheus configuration file: