From 6bdbbc6bbbdaf7f04b5ecf77583ea60d1641f0eb Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:12:18 +0100 Subject: [PATCH 1/4] feat: bump apm-data and go-docappender to stable version --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index f9dbb4644b6..6274fc9cc11 100644 --- a/go.mod +++ b/go.mod @@ -9,13 +9,13 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.4 github.com/dustin/go-humanize v1.0.1 github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6 - github.com/elastic/apm-data v0.1.1-0.20240206093737-3b28495c3cbd + github.com/elastic/apm-data v1.0.0 github.com/elastic/beats/v7 v7.0.0-alpha2.0.20240207112521-625ba402b8db github.com/elastic/elastic-agent-client/v7 v7.8.0 github.com/elastic/elastic-agent-libs v0.7.5 github.com/elastic/elastic-agent-system-metrics v0.9.1 github.com/elastic/gmux v0.3.1 - github.com/elastic/go-docappender v0.2.1-0.20231207080152-44217001fa53 + github.com/elastic/go-docappender v1.0.0 github.com/elastic/go-elasticsearch/v8 v8.12.0 github.com/elastic/go-sysinfo v1.12.0 github.com/elastic/go-ucfg v0.8.6 @@ -146,7 +146,7 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.elastic.co/apm/module/apmzap/v2 v2.4.7 // indirect + go.elastic.co/apm/module/apmzap/v2 v2.4.8 // indirect go.elastic.co/ecszap v1.0.2 // indirect go.opentelemetry.io/collector/semconv v0.93.0 // indirect go.opentelemetry.io/otel/sdk v1.23.0 // indirect diff --git a/go.sum b/go.sum index 55e392f58c8..e207a07a51e 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6 h1:Js+C3HEE0a5BDFmhEmJV/Uo4uzj/paHjd7yl6+KYguw= github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6/go.mod h1:ba3gaJCuhxXN/O5AuiI56xxd6DukQdVOK0NfpzBntNo= -github.com/elastic/apm-data v0.1.1-0.20240206093737-3b28495c3cbd h1:XKBsMg01zVauBEw/TjaEvfVxnwvZB+TKpioBZonAmkw= -github.com/elastic/apm-data v0.1.1-0.20240206093737-3b28495c3cbd/go.mod h1:z4iJVl8vyQa5v5o7UapWGHTsycBKsKfJfILuf2TZpYo= +github.com/elastic/apm-data v1.0.0 h1:23JEBSOq9bIKcocghV38so2mFZzdlFgst0Re+ApxuFo= +github.com/elastic/apm-data v1.0.0/go.mod h1:QUZMN5IFWhqbNfSUQxvd7Tuj7tx/6NoVJpFLAXd8ScY= github.com/elastic/beats/v7 v7.0.0-alpha2.0.20240207112521-625ba402b8db h1:nSZmeF2n4rWgZeviaErdQuTKephNbKRdVqjjkGOkbBs= github.com/elastic/beats/v7 v7.0.0-alpha2.0.20240207112521-625ba402b8db/go.mod h1:zqd/weIZvWV856AAltUc0eho6iAEKHx2TC4EXjoWQGE= github.com/elastic/elastic-agent-autodiscover v0.6.7 h1:+KVjltN0rPsBrU8b156gV4lOTBgG/vt0efFCFARrf3g= @@ -150,8 +150,8 @@ github.com/elastic/elastic-transport-go/v8 v8.4.0 h1:EKYiH8CHd33BmMna2Bos1rDNMM8 github.com/elastic/elastic-transport-go/v8 v8.4.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk= github.com/elastic/gmux v0.3.1 h1:ghT+5Y9jW5udQTBrhDeMOtQVdRBwk9Y2h1o+4Rb7mhE= github.com/elastic/gmux v0.3.1/go.mod h1:IBFLojLnACU9tsUnoSavOaMdhq63/HOH/Aeiiha36jA= -github.com/elastic/go-docappender v0.2.1-0.20231207080152-44217001fa53 h1:3jOfdobdHlfwC4yeTpljD6Ul+IWmhHHGHoUtn/Cb/UY= -github.com/elastic/go-docappender v0.2.1-0.20231207080152-44217001fa53/go.mod h1:v+pGb4IkluqgnVN4Qu3o9a2WC1jve91NCu19oKNK/tM= +github.com/elastic/go-docappender v1.0.0 h1:fXCOd5MEx+4qHIJjJqdtXODC2UNj0sxpO2K84N+/E7Y= +github.com/elastic/go-docappender v1.0.0/go.mod h1:escVC67Qgu2xTKP92H30/tNW0F+VWty5JfkLzew3URI= github.com/elastic/go-elasticsearch/v8 v8.12.0 h1:krkiCf4peJa7bZwGegy01b5xWWaYpik78wvisTeRO1U= github.com/elastic/go-elasticsearch/v8 v8.12.0/go.mod h1:wSzJYrrKPZQ8qPuqAqc6KMR4HrBfHnZORvyL+FMFqq0= github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f h1:TsPpU5EAwlt7YZoupKlxZ093qTZYdGou3EhfTF1U0B4= @@ -533,8 +533,8 @@ go.elastic.co/apm/module/apmhttp/v2 v2.4.8 h1:C1piLq4wcFHFB7jpFW1WPEyEl6zbRpf9SA go.elastic.co/apm/module/apmhttp/v2 v2.4.8/go.mod h1:FzO5ptAs5oKB3xE1/hpxMA0a7mLIycp2RZdBtp4+uTA= go.elastic.co/apm/module/apmotel/v2 v2.4.8 h1:XprKEoUFjcDFwWrmS56Go7D7Ndxa8uy+DVA4k1tItnY= go.elastic.co/apm/module/apmotel/v2 v2.4.8/go.mod h1:NA3k4fTqsQhhZBlMOGJy8ol20tJKLafEDWAr5ELNpTg= -go.elastic.co/apm/module/apmzap/v2 v2.4.7 h1:j96pvon+IhbFpzV4IflXwxOKD+l5rApyyN2ycarJG6Y= -go.elastic.co/apm/module/apmzap/v2 v2.4.7/go.mod h1:bi0A6hYYwModJI70LJDB8IHqw7291Ub16LRdEXNcOcU= +go.elastic.co/apm/module/apmzap/v2 v2.4.8 h1:bU1ESD6Pm2cx1Nmlos0YRQQrdQoFynbYP3imTfIxee4= +go.elastic.co/apm/module/apmzap/v2 v2.4.8/go.mod h1:+pWYgTIT9utt48DVOiBesXQZ3rOVERsE1cS+q0wUafo= go.elastic.co/apm/v2 v2.4.8 h1:3RuqxDjhgumT1BYxJGnVPdGY12lCzF+KGyvtSTynCYo= go.elastic.co/apm/v2 v2.4.8/go.mod h1:+CiBUdrrAGnGCL9TNx7tQz3BrfYV23L8Ljvotoc87so= go.elastic.co/ecszap v1.0.2 h1:iW5OGx8IiokiUzx/shD4AJCPFMC9uUtr7ycaiEIU++I= From 1e552de1e89a5366114927b346fba9798eb584f1 Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:12:51 +0100 Subject: [PATCH 2/4] fix: cap minimum flush bytes to 24kb to fix test failure --- internal/beater/beater.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/beater/beater.go b/internal/beater/beater.go index 31d997d2168..93a3d67abc0 100644 --- a/internal/beater/beater.go +++ b/internal/beater/beater.go @@ -696,6 +696,11 @@ func (s *Runner) newFinalBatchProcessor( } flushBytes = int(b) } + minFlush := 24 * 1024 + if esConfig.CompressionLevel != 0 && flushBytes < minFlush { + s.logger.Warnf("flush_bytes config value is too small (%d) and might be ignored by the indexer, increasing value to %d", flushBytes, minFlush) + flushBytes = minFlush + } client, err := newElasticsearchClient(esConfig.Config) if err != nil { return nil, nil, err From 9b4f7bf1163d2078919c79f4cc36b0298f0180bf Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:13:11 +0100 Subject: [PATCH 3/4] test: improve test assertions --- internal/beater/server_test.go | 2 +- internal/beater/tracing_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/beater/server_test.go b/internal/beater/server_test.go index 71e14429696..d5289612281 100644 --- a/internal/beater/server_test.go +++ b/internal/beater/server_test.go @@ -740,7 +740,7 @@ func TestWrapServer(t *testing.T) { req := makeTransactionRequest(t, srv.URL) req.Header.Add("Content-Type", "application/x-ndjson") res, err := srv.Client.Do(req) - assert.NoError(t, err) + require.NoError(t, err) res.Body.Close() doc := <-docs diff --git a/internal/beater/tracing_test.go b/internal/beater/tracing_test.go index 2a28df83297..aaf9a3508e3 100644 --- a/internal/beater/tracing_test.go +++ b/internal/beater/tracing_test.go @@ -57,7 +57,7 @@ func TestServerTracingEnabled(t *testing.T) { // Make an HTTP request to the server, which should be traced // if instrumentation is enabled. resp, err := srv.Client.Get(srv.URL + "/foo") - assert.NoError(t, err) + require.NoError(t, err) resp.Body.Close() if enabled { From 378089e032bed9b42e76cc6b01b799d5b4a7c59d Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:22:27 +0100 Subject: [PATCH 4/4] build: regenerate notice --- NOTICE.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 2d38133d86a..d93eed35e2b 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -362,11 +362,11 @@ these terms. -------------------------------------------------------------------------------- Dependency : github.com/elastic/apm-data -Version: v0.1.1-0.20240206093737-3b28495c3cbd +Version: v1.0.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v0.1.1-0.20240206093737-3b28495c3cbd/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v1.0.0/LICENSE: Apache License Version 2.0, January 2004 @@ -1462,11 +1462,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/gmux@v0.3.1/LIC -------------------------------------------------------------------------------- Dependency : github.com/elastic/go-docappender -Version: v0.2.1-0.20231207080152-44217001fa53 +Version: v1.0.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender@v0.2.1-0.20231207080152-44217001fa53/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender@v1.0.0/LICENSE: Apache License Version 2.0, January 2004 @@ -16376,11 +16376,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- Dependency : go.elastic.co/apm/module/apmzap/v2 -Version: v2.4.7 +Version: v2.4.8 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmzap/v2@v2.4.7/LICENSE: +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmzap/v2@v2.4.8/LICENSE: Apache License Version 2.0, January 2004