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 web doesn't respond on GET / HTTP/1.0 #3909
Comments
This comment has been minimized.
This comment has been minimized.
|
This is because Prometheus uses cockroach's cmux behind the scenes to serve gRPC and HTTP on the same listener. Not sure that there is nothing much to do about it. |
This comment has been minimized.
This comment has been minimized.
|
thank you, @simonpasquier. Your comment helped me to find the cause of the issue and a workaround. Why it happens:
So at this point the http2 matcher expects a certain amount of bytes to be passed. It doesn't conflict with the http2 spec - https://http2.github.io/http2-spec/#known-http If you swap the matchers GET / HTTP/1.0 works fine, it's not blocked anymore.
Cmux has its own limitation and for me this issue looks like misuse of cmux rather than a bug in the lib. What do you think? |
brian-brazil
added
kind/enhancement
component/ui
component/api
labels
Jun 13, 2018
This comment has been minimized.
This comment has been minimized.
tkausl
commented
Jun 25, 2018
|
The other |
angry-cellophane commentedMar 4, 2018
What did you do?
Let's say prometheus-web is running on localhost:9090
Send an http get request with no headers, version 1.0 to the root path.
e.g.
where is is the end of line character
What did you expect to see?
an http response from prometheus
What did you see instead? Under which circumstances?
no response, prometheus is waiting for more data from the client.
Originally, I found this issue when upgraded prometheus from version 1.7.1 to 2.1.0. I run prometheus in dcos. Dcos uses haproxy to load balance apps. HAProxy's default healthcheck doesn't work for prometheus 2.1.0 but it works for 1.7.1. The default healthcheck is GET / HTTP/1.0 with no headers.
If I send any http header prometheus sends the response immediately.
e.g.
The issue with HAProxy was resolved by defining a custom health check with additional headers.
It looks like a regression bug.
Environment
System information:
❯ uname -srm
Linux 4.10.10-200.fc25.x86_64 x86_64
Prometheus version:
❯ ./prometheus --version
prometheus, version 2.1.0 (branch: HEAD, revision: 85f23d8)
build user: root@6e784304d3ff
build date: 20180119-12:01:23
go version: go1.9.2