diff --git a/plugins/outputs/wavefront/README.md b/plugins/outputs/wavefront/README.md index 2d192d66967c0..4c357b3eb402b 100644 --- a/plugins/outputs/wavefront/README.md +++ b/plugins/outputs/wavefront/README.md @@ -15,6 +15,9 @@ Wavefront data format over TCP. ## Authentication Token for Wavefront. Only required if using Direct Ingestion #token = "DUMMY_TOKEN" + ## Number of metrics to send per batch for Direct Ingestion. Ignored unless 'url' is set. Default is 10,000. Values higher than 40,000 are not recommended. + # http_batch_size = 10000 + ## DNS name of the wavefront proxy server. Do not use if url is specified #host = "wavefront.example.com" diff --git a/plugins/outputs/wavefront/sample.conf b/plugins/outputs/wavefront/sample.conf index 142946b1c4cbd..95c85dc2f7104 100644 --- a/plugins/outputs/wavefront/sample.conf +++ b/plugins/outputs/wavefront/sample.conf @@ -7,6 +7,9 @@ ## Authentication Token for Wavefront. Only required if using Direct Ingestion #token = "DUMMY_TOKEN" + ## Number of metrics to send per batch for Direct Ingestion. Ignored unless 'url' is set. Default is 10,000. Values higher than 40,000 are not recommended. + # http_batch_size = 10000 + ## DNS name of the wavefront proxy server. Do not use if url is specified #host = "wavefront.example.com" diff --git a/plugins/outputs/wavefront/wavefront.go b/plugins/outputs/wavefront/wavefront.go index dabfad78facd9..2501a1860430b 100644 --- a/plugins/outputs/wavefront/wavefront.go +++ b/plugins/outputs/wavefront/wavefront.go @@ -29,6 +29,7 @@ type Wavefront struct { MetricSeparator string `toml:"metric_separator"` ConvertPaths bool `toml:"convert_paths"` ConvertBool bool `toml:"convert_bool"` + HTTPBatchSize int `toml:"http_batch_size"` UseRegex bool `toml:"use_regex"` UseStrict bool `toml:"use_strict"` TruncateTags bool `toml:"truncate_tags"` @@ -87,6 +88,7 @@ func (w *Wavefront) Connect() error { Server: w.URL, Token: w.Token, FlushIntervalSeconds: flushSeconds, + BatchSize: w., }) if err != nil { return fmt.Errorf("could not create Wavefront Sender for Url: %s", w.URL) @@ -298,6 +300,7 @@ func init() { ConvertBool: true, TruncateTags: false, ImmediateFlush: true, + : 10000, } }) } diff --git a/plugins/outputs/wavefront/wavefront_test.go b/plugins/outputs/wavefront/wavefront_test.go index 7868f48ec5349..057a28587acbb 100644 --- a/plugins/outputs/wavefront/wavefront_test.go +++ b/plugins/outputs/wavefront/wavefront_test.go @@ -8,6 +8,7 @@ import ( "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/metric" + "github.com/influxdata/telegraf/plugins/outputs" "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) @@ -354,6 +355,11 @@ func TestTagLimits(t *testing.T) { require.Equal(t, longKey, tags[longKey]) } +func TestDefaults(t *testing.T) { + defaultWavefront := outputs.Outputs["wavefront"]().(*Wavefront) + require.Equal(t, 10000, defaultWavefront.HttpBatchSize) +} + // Benchmarks to test performance of string replacement via Regex and Replacer var testString = "this_is*my!test/string\\for=replacement"