Skip to content

Prometheus exporter should support compressed responses #11320

@Lusitaniae

Description

@Lusitaniae

Is your feature request related to a problem? Please describe.
I'm using fluentd to generate metrics based on haproxy logs and there's fairly high cardinality leading to large response bodies and possibly timeouts during scraping.

Compression is fast and significantly cuts down on payload being transferred over the internet

Prometheus remote write plugin already supports compression, but the exporter plugin should have the same option

Checking one of the servers, compression cuts payload from 37Mb to 2Mb

$ curl -s http://node1:9106/metrics | wc -c
37420840
$ curl -s http://node1:9106/metrics | gzip -c | wc -c
1877477

Describe the solution you'd like
Prometheus exporter should read Accept Encoding header and be able to return compressed responses

See fluentd plugin implementation

https://github.com/fluent/fluent-plugin-prometheus/pull/223/changes

Describe alternatives you've considered

  • Prometheus remote write
  • keep using fluentd

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions