From c74896ed7acbb92921ee46fa5e3d66d575a8b0a9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:36:29 +0000 Subject: [PATCH] x-pack/filebeat/input/{cel,httpjson}: fix typo in minimum log length (#39834) (#39852) (cherry picked from commit 1fd65c7f980d69886cb894014f4e9737ce05bb71) Co-authored-by: Dan Kortschak --- CHANGELOG-developer.next.asciidoc | 1 + x-pack/filebeat/input/cel/input.go | 2 +- x-pack/filebeat/input/httpjson/input.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-developer.next.asciidoc b/CHANGELOG-developer.next.asciidoc index d6bacc653b9a..568c02f4ed1f 100644 --- a/CHANGELOG-developer.next.asciidoc +++ b/CHANGELOG-developer.next.asciidoc @@ -98,6 +98,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only. - Fix panic when more than 32767 pipeline clients are active. {issue}38197[38197] {pull}38556[38556] - Skip flakey metrics test on windows in filebeat httpjson input. {issue}39676[39676] {pull}39678[39678] - Fix flakey test on Windows 2022 in packetbeat/route. {issue}39698[39698] {pull}39822[39822] +- Fix bug in minimum length for request trace logging. {pull}39834[39834] ==== Added diff --git a/x-pack/filebeat/input/cel/input.go b/x-pack/filebeat/input/cel/input.go index 3428a730ce34..d53a6580b0bf 100644 --- a/x-pack/filebeat/input/cel/input.go +++ b/x-pack/filebeat/input/cel/input.go @@ -723,7 +723,7 @@ func newClient(ctx context.Context, cfg config, log *logp.Logger) (*http.Client, ) traceLogger := zap.New(core) - const margin = 1e3 // 1OkB ought to be enough room for all the remainder of the trace details. + const margin = 10e3 // 1OkB ought to be enough room for all the remainder of the trace details. maxSize := cfg.Resource.Tracer.MaxSize * 1e6 trace = httplog.NewLoggingRoundTripper(c.Transport, traceLogger, max(0, maxSize-margin), log) c.Transport = trace diff --git a/x-pack/filebeat/input/httpjson/input.go b/x-pack/filebeat/input/httpjson/input.go index 0def1cbd8b6b..fff616562959 100644 --- a/x-pack/filebeat/input/httpjson/input.go +++ b/x-pack/filebeat/input/httpjson/input.go @@ -259,7 +259,7 @@ func newNetHTTPClient(ctx context.Context, cfg *requestConfig, log *logp.Logger, ) traceLogger := zap.New(core) - const margin = 1e3 // 1OkB ought to be enough room for all the remainder of the trace details. + const margin = 10e3 // 1OkB ought to be enough room for all the remainder of the trace details. maxSize := cfg.Tracer.MaxSize*1e6 - margin if maxSize < 0 { maxSize = 0