diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 20948ff8ac5..e46b86b33ed 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -62,6 +62,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff] - Fix Google workspace pagination and document ID generation. {pull}33666[33666] *Heartbeat* +- Fix broken zip URL monitors. NOTE: Zip URL Monitors will be removed in version 8.7 and replaced with project monitors. {pull}33723[33723] - Fix bug affecting let's encrypt and other users of cross-signed certs, where cert expiration was incorrectly calculated. {issue}33215[33215] - Fix broken disable feature for kibana configured monitors. {pull}33293[33293] - Fix states client support for output options. {pull}33405[33405] diff --git a/x-pack/heartbeat/monitors/browser/synthexec/enrich.go b/x-pack/heartbeat/monitors/browser/synthexec/enrich.go index 6e98e26fba8..6cfab119426 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/enrich.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/enrich.go @@ -25,9 +25,10 @@ import ( type enricher func(event *beat.Event, se *SynthEvent) error type streamEnricher struct { - je *journeyEnricher - sFields stdfields.StdMonitorFields - checkGroup string + je *journeyEnricher + journeyCount int + sFields stdfields.StdMonitorFields + checkGroup string } func newStreamEnricher(sFields stdfields.StdMonitorFields) *streamEnricher { @@ -39,8 +40,15 @@ func (senr *streamEnricher) enrich(event *beat.Event, se *SynthEvent) error { senr.je = newJourneyEnricher(senr) } - eventext.MergeEventFields(event, map[string]interface{}{"monitor": map[string]interface{}{"check_group": senr.checkGroup}}) + // TODO: Remove this when zip monitors are removed and we have 1:1 monitor / journey + if se != nil && se.Type == JourneyStart { + senr.journeyCount++ + if senr.journeyCount > 1 { + senr.checkGroup = makeUuid() + } + } + eventext.MergeEventFields(event, map[string]interface{}{"monitor": map[string]interface{}{"check_group": senr.checkGroup}}) return senr.je.enrich(event, se) } @@ -153,7 +161,7 @@ func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) e eventext.MergeEventFields(event, se.ToMap()) - if je.urlFields == nil { + if len(je.urlFields) == 0 { if urlFields, err := event.GetValue("url"); err == nil { if ufMap, ok := urlFields.(mapstr.M); ok { je.urlFields = ufMap @@ -206,10 +214,6 @@ func (je *journeyEnricher) createSummary(event *beat.Event) error { if je.journeyComplete { return je.error } - - // create a new check group for the next journey - je.streamEnricher.checkGroup = makeUuid() - return fmt.Errorf("journey did not finish executing, %d steps ran: %w", je.stepCount, je.error) }