diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index c6b4b4e6e4f3..9afbaf2e5871 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -167,6 +167,7 @@ Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will d - Update CEL extensions library to v1.7.0. {pull}37172[37172] - Add support for complete URL replacement in HTTPJSON chain steps. {pull}37486[37486] - Add support for user-defined query selection in EntraID entity analytics provider. {pull}37653[37653] +- Add request trace logging for chained API requests. {issue}37551[36551] {pull}37682[37682] *Auditbeat* diff --git a/x-pack/filebeat/input/httpjson/input.go b/x-pack/filebeat/input/httpjson/input.go index 928c056d2d39..17877b607013 100644 --- a/x-pack/filebeat/input/httpjson/input.go +++ b/x-pack/filebeat/input/httpjson/input.go @@ -122,6 +122,16 @@ func run(ctx v2.Context, cfg config, pub inputcursor.Publisher, crsr *inputcurso if cfg.Request.Tracer != nil { id := sanitizeFileName(ctx.ID) cfg.Request.Tracer.Filename = strings.ReplaceAll(cfg.Request.Tracer.Filename, "*", id) + + // Propagate tracer behaviour to all chain children. + for i, c := range cfg.Chain { + if c.Step != nil { // Request is validated as required. + cfg.Chain[i].Step.Request.Tracer = cfg.Request.Tracer + } + if c.While != nil { // Request is validated as required. + cfg.Chain[i].While.Request.Tracer = cfg.Request.Tracer + } + } } metrics := newInputMetrics(reg)