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

Initial work toward synthetic monitors #21436

Merged
merged 54 commits into from
Dec 21, 2020
Merged

Initial work toward synthetic monitors #21436

merged 54 commits into from
Dec 21, 2020

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Sep 30, 2020

Initial, experimental version of synthetic monitor support for Heartbeat. This works in concert with https://github.com/elastic/synthetics , and is intended to only be run within the docker container built in the synthetics repo. This is guarded by the new ELASTIC_SYNTHETICS_CAPABLE env variable which must be set to true. As a note, this is easy to bypass because the main purpose is to make it clear that we do not support synthetics outside of the docker container for now.

This includes a new directory, sample-synthetics-config in the x-pack directory that demonstrates using heartbeat with synthetics. In the future

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

You can check that this PR works by running (in the x-pack/heartbeat directory):
mage build && env ELASTIC_SYNTHETICS_CAPABLE=true ./heartbeat --path.config sample-synthetics-config/ -e

@andrewvc andrewvc added enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Sep 30, 2020
@andrewvc andrewvc self-assigned this Sep 30, 2020
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Sep 30, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 30, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #21436 updated

  • Start Time: 2020-12-18T21:06:52.448+0000

  • Duration: 102 min 53 sec

Test stats 🧪

Test Results
Failed 0
Passed 17502
Skipped 1383
Total 18885

Steps errors 2

Expand to view the steps failures

Terraform Apply on x-pack/metricbeat/module/aws
  • Took 0 min 14 sec . View more details on here
  • Description: terraform apply -auto-approve
Terraform Apply on x-pack/metricbeat/module/aws
  • Took 0 min 15 sec . View more details on here
  • Description: terraform apply -auto-approve

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 17502
Skipped 1383
Total 18885

}

func TestRunCmd(t *testing.T) {
cmd := exec.Command("go", "run", "./main.go")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blakerouse I hope this test addresses your concern re: covering actual binary execution!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes it does. Exactly what I was asking for.

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

This looks great and excited to see it finally landing.

I am interested in getting this to work under Agent without needing a container. Seems playwright works on Linux, Mac, and Windows. I am sure we can come up with a way to bundle it all, not requiring a special container.

}

func TestRunCmd(t *testing.T) {
cmd := exec.Command("go", "run", "./main.go")
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes it does. Exactly what I was asking for.

"with",
"write"}

fmt.Println("SYSCALLS !!!\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forgot to remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch!

@andrewvc
Copy link
Contributor Author

/packaging

@andrewvc andrewvc marked this pull request as ready for review December 18, 2020 14:13
@andrewvc andrewvc requested review from a team as code owners December 18, 2020 14:13
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@andrewvc
Copy link
Contributor Author

/packaging test
/test

@andrewvc
Copy link
Contributor Author

/test this

@andrewvc
Copy link
Contributor Author

/packaging this

@botelastic botelastic bot added the Team:Automation Label for the Observability productivity team label Dec 18, 2020
@andrewvc
Copy link
Contributor Author

/test this

1 similar comment
@andrewvc
Copy link
Contributor Author

/test this

@@ -0,0 +1,122 @@
#!/usr/bin/env groovy
Copy link
Member

Choose a reason for hiding this comment

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

Is this particular pipeline required? The current CI pipeline does not use it, so I wonder if the packaging pipeline should be the one to be used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kuisathaverat would be the best one to ping here since he added that to this PR. However, I do believe it's essential (today) to make the custom synthetics image based off this branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

since the x-pack/heartbeat is build in package pipeline, I do not think we need the groovy file. the heartbeat Docker image will be the new synthetics docker image. this pipeline is only to change the name to the Docker image to ...-synthetics

@andrewvc andrewvc merged commit e50f673 into master Dec 21, 2020
andrewvc added a commit to andrewvc/beats that referenced this pull request Dec 21, 2020
Initial, experimental version of synthetic monitor support for Heartbeat. This works in concert with https://github.com/elastic/synthetics , and is intended to only be run within the docker container built in the synthetics repo. This is guarded by the new ELASTIC_SYNTHETICS_CAPABLE env variable which must be set to true. As a note, this is easy to bypass because the main purpose is to make it clear that we do not support synthetics outside of the docker container for now.

This includes a new directory, sample-synthetics-config in the x-pack directory that demonstrates using heartbeat with synthetics.

Since we still only want people to run this in the docker image, we guard against accidental use outside of that by checking for the env var ELASTIC_SYNTHETICS_CAPABLE, which we only set in that image (yes, this is easy to circumvent, but we want users to realize they are circumventing something before they do so)

(cherry picked from commit e50f673)
andrewvc added a commit that referenced this pull request Jan 29, 2021
…3224)

* Initial work toward synthetic monitors (#21436)

Initial, experimental version of synthetic monitor support for Heartbeat. This works in concert with https://github.com/elastic/synthetics , and is intended to only be run within the docker container built in the synthetics repo. This is guarded by the new ELASTIC_SYNTHETICS_CAPABLE env variable which must be set to true. As a note, this is easy to bypass because the main purpose is to make it clear that we do not support synthetics outside of the docker container for now.

This includes a new directory, sample-synthetics-config in the x-pack directory that demonstrates using heartbeat with synthetics.

Since we still only want people to run this in the docker image, we guard against accidental use outside of that by checking for the env var ELASTIC_SYNTHETICS_CAPABLE, which we only set in that image (yes, this is easy to circumvent, but we want users to realize they are circumventing something before they do so)

(cherry picked from commit e50f673)
andrewvc added a commit that referenced this pull request Jan 29, 2021
Initial, experimental version of synthetic monitor support for Heartbeat. This works in concert with https://github.com/elastic/synthetics , and is intended to only be run within the docker container built in the synthetics repo. This is guarded by the new ELASTIC_SYNTHETICS_CAPABLE env variable which must be set to true. As a note, this is easy to bypass because the main purpose is to make it clear that we do not support synthetics outside of the docker container for now.

This includes a new directory, sample-synthetics-config in the x-pack directory that demonstrates using heartbeat with synthetics.

Since we still only want people to run this in the docker image, we guard against accidental use outside of that by checking for the env var ELASTIC_SYNTHETICS_CAPABLE, which we only set in that image (yes, this is easy to circumvent, but we want users to realize they are circumventing something before they do so)
@zube zube bot removed the [zube]: Done label Mar 22, 2021
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Initial, experimental version of synthetic monitor support for Heartbeat. This works in concert with https://github.com/elastic/synthetics , and is intended to only be run within the docker container built in the synthetics repo. This is guarded by the new ELASTIC_SYNTHETICS_CAPABLE env variable which must be set to true. As a note, this is easy to bypass because the main purpose is to make it clear that we do not support synthetics outside of the docker container for now.

This includes a new directory, sample-synthetics-config in the x-pack directory that demonstrates using heartbeat with synthetics.

Since we still only want people to run this in the docker image, we guard against accidental use outside of that by checking for the env var ELASTIC_SYNTHETICS_CAPABLE, which we only set in that image (yes, this is easy to circumvent, but we want users to realize they are circumventing something before they do so)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Automation Label for the Observability productivity team Team:obs-ds-hosted-services Label for the Observability Hosted Services team v7.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants