Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Heartbeat] Fix zip monitors #33723

Merged
merged 11 commits into from
Nov 21, 2022
2 changes: 1 addition & 1 deletion x-pack/heartbeat/heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ setup.kibana:
# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.

#output.console: ~
# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
# Array of hosts to connect to.
Expand Down
12 changes: 12 additions & 0 deletions x-pack/heartbeat/monitors.d/zipurl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

- name: TDZIP
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be commited?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, nope

id: tdzip
type: browser
schedule: "@every 3m"
tags: todos-app
params:
url: "https://elastic.github.io/synthetics-demo/"
source:
zip_url:
url: "https://github.com/elastic/synthetics-demo/archive/refs/heads/main.zip"
folder: "todos"
11 changes: 7 additions & 4 deletions x-pack/heartbeat/monitors/browser/synthexec/enrich.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) e
}

func (je *journeyEnricher) createSummary(event *beat.Event) error {
// TODO: Remove this when zip monitors are removed and we have 1:1 monitor / journey
defer func() {
if je != nil && je.streamEnricher != nil {
je.streamEnricher.checkGroup = makeUuid()
}
}()

var up, down int
if je.errorCount > 0 {
up = 0
Expand Down Expand Up @@ -206,10 +213,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)
}

Expand Down