Add config option to specify whether to use GZip compression in influx write requests

This commit is contained in:
Holger Obermaier 2023-10-09 16:57:26 +02:00
parent 3be11984f2
commit 8837400bf2
2 changed files with 8 additions and 1 deletions

View File

@ -53,6 +53,8 @@ type InfluxSink struct {
InfluxMaxRetries uint `json:"max_retries,omitempty"`
// maximum total retry timeout
InfluxMaxRetryTime string `json:"max_retry_time,omitempty"`
// Specify whether to use GZip compression in write requests
InfluxUseGzip bool `json:"use_gzip"`
}
batch []string
flushTimer *time.Timer
@ -129,6 +131,9 @@ func (s *InfluxSink) connect() error {
}
}
// Specify whether to use GZip compression in write requests
clientOptions.SetUseGZip(s.config.InfluxUseGzip)
// Do not check InfluxDB certificate
clientOptions.SetTLSConfig(
&tls.Config{

View File

@ -17,7 +17,8 @@ The `influxdb` sink uses the official [InfluxDB golang client](https://pkg.go.de
"organization": "myorg",
"ssl": true,
"flush_delay" : "1s",
"batch_size" : 1000
"batch_size" : 1000,
"use_gzip": true
}
}
```
@ -40,3 +41,4 @@ Influx client options:
- `retry_exponential_base`: base for the exponential retry delay
- `max_retries`: maximum count of retry attempts of failed writes
- `max_retry_time`: maximum total retry timeout
- `use_gzip`: Specify whether to use GZip compression in write requests