From b4aabbd6935a3870007c30a27b5eaa300e0b4d35 Mon Sep 17 00:00:00 2001
From: Fae Charlton <fae.charlton@elastic.co>
Date: Thu, 16 Jan 2025 18:02:46 -0500
Subject: [PATCH] increase backoff for 'scale' preset

---
 libbeat/outputs/elasticsearch/config_presets.go |  2 ++
 .../elasticsearch/docs/elasticsearch.asciidoc   | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/libbeat/outputs/elasticsearch/config_presets.go b/libbeat/outputs/elasticsearch/config_presets.go
index eab3c9e18d81..1fa01d82fa0e 100644
--- a/libbeat/outputs/elasticsearch/config_presets.go
+++ b/libbeat/outputs/elasticsearch/config_presets.go
@@ -63,6 +63,8 @@ var presetConfigs = map[string]*config.C{
 		"queue.mem.flush.timeout":    20 * time.Second,
 		"compression_level":          1,
 		"idle_connection_timeout":    1 * time.Second,
+		"backoff.init":               5 * time.Second,
+		"backoff.max":                300 * time.Second,
 	}),
 	presetLatency: config.MustNewConfigFrom(map[string]interface{}{
 		"bulk_max_size":              50,
diff --git a/libbeat/outputs/elasticsearch/docs/elasticsearch.asciidoc b/libbeat/outputs/elasticsearch/docs/elasticsearch.asciidoc
index 3bfc0ad9bd5e..d8487b01e29e 100644
--- a/libbeat/outputs/elasticsearch/docs/elasticsearch.asciidoc
+++ b/libbeat/outputs/elasticsearch/docs/elasticsearch.asciidoc
@@ -680,6 +680,8 @@ Setting `bulk_max_size` to values less than or equal to 0 disables the
 splitting of batches. When splitting is disabled, the queue decides on the
 number of events to be contained in a batch.
 
+
+[[backoff-init-option]]
 ===== `backoff.init`
 
 The number of seconds to wait before trying to reconnect to Elasticsearch after
@@ -689,6 +691,7 @@ to `backoff.max`. After a successful connection, the backoff timer is reset. The
 default is `1s`.
 
 
+[[backoff-max-option]]
 ===== `backoff.max`
 
 The maximum number of seconds to wait before attempting to connect to
@@ -774,7 +777,7 @@ output.elasticsearch:
   preset: balanced
 ------------------------------------------------------------------------------
 
-Performance presets apply a set of configuration overrides based on a desired performance goal. If set, a performance preset will override other configuration flags to match the recommended settings for that preset. Valid options are:
+Performance presets apply a set of configuration overrides based on a desired performance goal. If set, a performance preset will override other configuration flags to match the recommended settings for that preset. If a preset doesn't set a value for a particular field, the user-specified value will be used if present, otherwise the default. Valid options are:
 * `balanced`: good starting point for general efficiency
 * `throughput`: good for high data volumes, may increase cpu and memory requirements
 * `scale`: reduces ambient resource use in large low-throughput deployments
@@ -830,6 +833,18 @@ Presets represent current recommendations based on the intended goal; their effe
 |`15s`
 |`1s`
 |`60s`
+
+|<<backoff-init-option,`backoff.init`>>
+|none
+|none
+|`5s`
+|none
+
+|<<backoff-max-option,`backoff.max`>>
+|none
+|none
+|`300s`
+|none
 |===
 
 [[es-apis]]