Prometheus: Support for GZIP compression on federation endpoint

Created on 25 Jul 2017  路  4Comments  路  Source: prometheus/prometheus

Hi,

I'd like to know if there is support to enable GZIP compression on the federation endpoint? I noticed that right now "text/plain" is used without compression. I'm looking for something like:

Content-Type: text/plain
Content-Encoding: gzip

Currently I am confronted with 55k line of metrics, resulting in 23.1MB of plain text data to be send every scrape interval. When there would be support for GZIP compression, the wire transfer amount would be 1.7MB, resulting in 92% of bandwidth saviour.

Example metrics attached as file.
metrics.log.gz

Most helpful comment

Thanks for your quick response @brian-brazil .

Exactly how is this configured on the configuration side (https://prometheus.io/docs/operating/federation) or is this done out of the box?

BR,
Bart

All 4 comments

We already support gzip compression. You need to set the Accept-Encoding: gzip HTTP header.

curl -v -s -H 'Accept-Encoding: gzip' 'http://demo.robustperception.io:9090/federate?match\[\]=up%7Bjob%3D%22prometheus%22%7D' >/dev/null 2>&1 | grep Content-        
< Content-Encoding: gzip
< Content-Type: text/plain; version=0.0.4
< Content-Length: 124

Thanks for your quick response @brian-brazil .

Exactly how is this configured on the configuration side (https://prometheus.io/docs/operating/federation) or is this done out of the box?

BR,
Bart

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.

Was this page helpful?
0 / 5 - 0 ratings