chproxy icon indicating copy to clipboard operation
chproxy copied to clipboard

Support `/ping` endpoint

Open mr-karan opened this issue 2 years ago • 1 comments

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.

mr-karan avatar Dec 08 '21 08:12 mr-karan

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.

vfoucault avatar Dec 14 '21 16:12 vfoucault

Hi @mr-karan , this feature has been released along with the version v0.17.0

gontarzpawel avatar Aug 30 '22 07:08 gontarzpawel

@gontarzpawel I still get unsupported path: "/ping" with the latest chproxy ver. 1.21.0 Is there any configs missed?

allen12921 avatar Jan 31 '23 07:01 allen12921

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?

ssube avatar Nov 21 '23 19:11 ssube