go-graphite / carbon-clickhouse

Graphite metrics receiver with ClickHouse as storage
MIT License
186 stars 47 forks source link

Enable gzip compression for uploading to clickhouse #58

Closed majedrze closed 4 years ago

majedrze commented 4 years ago

Hi,

carbon-clickhouse does not compress POST body when sending to clickhouse, even if it can.

This PR adds support for gzip compression along with an appropriate config switch. We do send metrics to CH across the ocean, and since the network speed sometimes varies a lot, gzipping would allow us to somewhat mitigate the issue by decreasing the volume of data sent by 5x-10x.

This PR does not break default behaviour (default is still uncompressed).