Skip to content

Commit

Permalink
[Heartbeat]: capture error from journey/end events (#26781) (#26854)
Browse files Browse the repository at this point in the history
(cherry picked from commit 11b545a)

Co-authored-by: Vignesh Shanmugam <vignesh.shanmugam22@gmail.com>
  • Loading branch information
mergify[bot] and vigneshshanmugam committed Jul 12, 2021
1 parent 4faeca5 commit c4a3d5d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions x-pack/heartbeat/monitors/browser/synthexec/enrich.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ func (je *journeyEnricher) enrich(event *beat.Event, se *SynthEvent) error {
}

func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) error {
var jobErr error
if se.Error != nil {
jobErr = stepError(se.Error)
je.errorCount++
if je.firstError == nil {
je.firstError = jobErr
}
}

switch se.Type {
case "journey/end":
je.journeyComplete = true
Expand Down Expand Up @@ -133,16 +142,6 @@ func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) e
}
}
}

var jobErr error
if se.Error != nil {
jobErr = stepError(se.Error)
je.errorCount++
if je.firstError == nil {
je.firstError = jobErr
}
}

return jobErr
}

Expand Down

0 comments on commit c4a3d5d

Please sign in to comment.