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

Cherry-pick #23467 to 7.x: [Heartbeat] Refactor config system #24087

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Feb 17, 2021

Cherry-pick of PR #23467 to 7.x branch. Original message:

This PR:

  • Refactors the config for synthetics suites to act as regular monitors under heartbeat.monitors rather than have the new top-level synthetic.suites syntax we've been using so far.
  • Changes the behavior of local suites to copy their data into the container rather than run directly off the shared docker volume
  • Adds a first-class notion of aliasing to monitor types, so that synthetics/http monitors show up as http, and not as a distinct type (applies to all monitor types)
  • Simplifies the types associated with monitor plugins into a new plugin.Plugin{} struct, rather than passing around multiple values everywhere.
  • See https://github.com/elastic/beats/pull/23467/files#diff-7f1e5387c4757cca1e98483a5678e377a28ca5f9d77b267a4121a14249c96b82R7 for an example of the new config syntax

More on the change to copying local tests into the container

The rationale here is that doing so resolves any file permissions issues that may be present due to the suite directory being shared to the container as read only OR due to incompatible UIDs between the docker container and the host.

Fixes elastic/synthetics#156
Fixes #23823

As a note, no tests are added here due to the complexity of testing this small amount of I/O functionality, however, any issues should be caught by our E2E tests in https://github.com/elastic/synthetics/tree/master/__tests__/e2e . I've opened an issue to improve this situation here: #23346

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Takes over from #23347
Fixes elastic/synthetics#156
Fixes elastic/uptime#271

Use cases

Screenshots

Logs

* Refactors the config for synthetics suites to act as regular monitors under `heartbeat.monitors` rather than have the new top-level `synthetic.suites` syntax we've been using so far.
* Changes the behavior of local suites to copy their data into the container rather than run directly off the shared docker volume
* Adds a first-class notion of aliasing to monitor types, so that `synthetics/http` monitors show up as `http`, and not as a distinct type (applies to all monitor types)
* Simplifies the types associated with monitor plugins into a new `plugin.Plugin{}` struct, rather than passing around multiple values everywhere.
* See https://github.com/elastic/beats/pull/23467/files#diff-7f1e5387c4757cca1e98483a5678e377a28ca5f9d77b267a4121a14249c96b82R7 for an example of the new config syntax

#### More on the change to copying local tests into the container

The rationale here is that doing so resolves any file permissions issues that may be present due to the suite directory being shared to the container as read only OR due to incompatible UIDs between the docker container and the host.

Fixes elastic/synthetics#156
Fixes elastic#23823

As a note, no tests are added here due to the complexity of testing this small amount of I/O functionality, however, any issues should be caught by our E2E tests in https://github.com/elastic/synthetics/tree/master/__tests__/e2e . I've opened an issue to improve this situation here: elastic#23346

(cherry picked from commit fb25ded)
@andrewvc andrewvc requested a review from a team as a code owner February 17, 2021 14:27
@andrewvc andrewvc added [zube]: In Review backport Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Feb 17, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@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 Feb 17, 2021
@andrewvc andrewvc requested a review from blakerouse February 17, 2021 14:46
@elasticmachine
Copy link
Collaborator

💚 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 #24087 opened

  • Start Time: 2021-02-17T14:28:12.544+0000

  • Duration: 32 min 27 sec

  • Commit: efbfb13

Test stats 🧪

Test Results
Failed 0
Passed 3254
Skipped 76
Total 3330

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 3254
Skipped 76
Total 3330

@@ -49,6 +49,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Rename `s3` input to `aws-s3` input. {pull}23469[23469]

*Heartbeat*
- Adds negative body match. {pull}20728[20728]
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this a mistake also introduced in master, or done in purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix in a follow-up PR, good catch!

@andrewvc andrewvc merged commit f8b654d into elastic:7.x Feb 17, 2021
@andrewvc andrewvc deleted the backport_23467_7.x branch February 17, 2021 18:45
@zube zube bot removed the [zube]: Done label May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants