opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[confighttp] Make the compression level configurable

Open rnishtala-sumo opened this issue 1 year ago • 5 comments

Current compression algorithms seem to support multiple compression levels. These levels determine the speed and efficiency of the compression algorithm.

Lower compression levels provide faster speed but larger file sizes. Compression levels could be 3, 5, 7 or 11. Level 3 seems to be the default across multiple compression algorithms. It could benefit a user to give them the option to save on AWS egress costs by configuring a higher compression level with a tradeoff on processing speed.

Example configuration could looks like below:

exporter:
  otlphttp:
    endpoint: otelcol2:55690
    auth:
      authenticator: some-authenticator-extension
    tls:
      ca_file: ca.pem
      cert_file: cert.pem
      key_file: key.pem
    headers:
      test1: "value1"
      "test 2": "value 2"
    compression
       type: zstd
       level: 7
    cookies:
      enabled: true

rnishtala-sumo avatar Jun 26 '24 15:06 rnishtala-sumo

I like the idea of configuring this as a single string

exporter:
  otlphttp:
    endpoint: otelcol2:55690
    auth:
      authenticator: some-authenticator-extension
    tls:
      ca_file: ca.pem
      cert_file: cert.pem
      key_file: key.pem
    headers:
      test1: "value1"
      "test 2": "value 2"
    compression: zstd/7
    cookies:
      enabled: true

rnishtala-sumo avatar Jun 26 '24 17:06 rnishtala-sumo

Hi @mx-psi /@rnishtala-sumo , is this open for contribution?

wasim-nihal avatar Jul 15 '24 12:07 wasim-nihal

@wasim-nihal yes, please proceed if this issue is of interest to you. I can assist with the PR review.

rnishtala-sumo avatar Jul 15 '24 21:07 rnishtala-sumo

@mx-psi @dmitryax if there's no one working on this, could this issue be assigned to me?

rnishtala-sumo avatar Aug 21 '24 15:08 rnishtala-sumo

Assigned!

mx-psi avatar Aug 22 '24 08:08 mx-psi

@dmitryax @mx-psi I've raised a PR for this issue. Would appreciate your review.

rnishtala-sumo avatar Sep 11 '24 16:09 rnishtala-sumo

The latest approach to configuring this is as follows

exporter:
  otlphttp:
    endpoint: otelcol2:55690
    auth:
      authenticator: some-authenticator-extension
    tls:
      ca_file: ca.pem
      cert_file: cert.pem
      key_file: key.pem
    headers:
      test1: "value1"
      "test 2": "value 2"
    compression
       type: zstd
    compression_params:
       level: 1
    cookies:
      enabled: true

If the compression level is not set (0), then we use the default compression level (-1). This is consistent with the current behavior.

cc: @dmitryax

rnishtala-sumo avatar Jan 13 '25 15:01 rnishtala-sumo