chproxy
chproxy copied to clipboard
Support `/ping` endpoint
Clickhouse returns a HTTP 200
response for /ping
URL. However, this library doesn't support proxying that.
I want to add that /metrics
won't work always, because that is optional and moreover, user can set any value for metrics endpoint (as mentioned here: https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings/#server_configuration_parameters-prometheus)
/ping
should be the standard way to do healthchecks.
In health-check scripts use GET /ping request. This handler always returns “Ok.” (with a line feed at the end). Available from version 18.12.13.
https://clickhouse.com/docs/en/interfaces/http/
Additionally, queries on /
are also proxied to /query
which feels wrong too.
If you make a GET / request without parameters, it returns 200 response code and the string which defined in http_server_default_response default value “Ok.” (with a line feed at the end)
^ To conform to the API of Clickhouse, I believe the proxy should behave the same.
Hi @mr-karan,
It seems right to align chproxy on clickhouse api.
Feel free to issue a PR to fix this is you know how.
Hi @mr-karan , this feature has been released along with the version v0.17.0
@gontarzpawel
I still get unsupported path: "/ping"
with the latest chproxy ver. 1.21.0
Is there any configs missed?
Is this supported in recent versions? I am also getting unsupported path: "/ping"
errors on the server side, which looks like the code at https://github.com/ContentSquare/chproxy/blob/master/main.go#L252. I don't see a case
for "/ping"
there - what am I missing?