diff --git a/sinks/influxSink.go b/sinks/influxSink.go index ac7382a..5bdf5c6 100644 --- a/sinks/influxSink.go +++ b/sinks/influxSink.go @@ -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{ diff --git a/sinks/influxSink.md b/sinks/influxSink.md index 7bd5d18..258ecb5 100644 --- a/sinks/influxSink.md +++ b/sinks/influxSink.md @@ -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