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

[Elastic Agent] Add support for synthetics inputs that run heartbeat #20387

Merged
merged 5 commits into from
Aug 6, 2020

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Jul 31, 2020

What does this PR do?

This adds support for any input with synthetics/* to run heartbeat and send the inputs to heartbeat. This also bundles heartbeat with Elastic Agent in data/downloads.

Note: Currently heartbeat doesn't support the top-level inputs key. Once it does this will just work.

Why is it important?

To support running heartbeat with synthetics inputs.

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.

Related issues

@blakerouse blakerouse self-assigned this Jul 31, 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 Jul 31, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 31, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20387 updated]

  • Start Time: 2020-08-06T13:33:40.416+0000

  • Duration: 80 min 38 sec

Test stats 🧪

Test Results
Failed 0
Passed 17828
Skipped 1920
Total 19748

@@ -523,7 +523,7 @@ func packageAgent(requiredPackages []string, packagingFn func()) {
defer os.RemoveAll(dropPath)
defer os.Unsetenv(agentDropPath)

packedBeats := []string{"filebeat", "metricbeat"}
packedBeats := []string{"filebeat", "heartbeat", "metricbeat"}
Copy link
Contributor

Choose a reason for hiding this comment

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

@blakerouse Do we directly have to bundle it to play around with it or would download work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruflin We do have to bundle it to work with it from master. On a SNAPSHOT build it would be able to download. I think its best to bundle it, as we are going to now bundle Endpoint as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

This helps air gapped users right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This helps developers that use mage package inside of x-pack/elastic-agent to build Elastic Agent when heartbeat bundled. Which you want to do to easy testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with bundle it at the moment in master to move forward but we should have a separate discussion if we want to package it or not as we did for other other binaries.

@blakerouse blakerouse marked this pull request as ready for review August 3, 2020 17:41
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@andrewvc andrewvc added Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Aug 4, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

Thanks for the great work here @blakerouse left some minor feedback

id: unique-http-id
name: my-http
schedule: '*/5 * * * * * *'
hosts: ["http://localhost:80/service/status"]
Copy link
Contributor

Choose a reason for hiding this comment

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

The one change I'd like to make vs. heartbeat as it is today is to make this singular instead of plural.

Copy link
Contributor

Choose a reason for hiding this comment

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

@blakerouse If i understand it correctly, the files you have here are "only" for testing but in the end we just forward the blog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruflin Correct, it's just for testing. We forward all the content to heartbeat, it could have an invalid name in there like foo: bar and that would also be sent.

I will still update the test so it matches the expected structure.

id: unique-http-id
name: my-http
schedule: '*/5 * * * * * *'
hosts: ["http://localhost:80/service/status"]
Copy link
Contributor

Choose a reason for hiding this comment

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

same, s/hosts/host/

@blakerouse blakerouse force-pushed the agent-synthetics-config branch from f2b5beb to 1b5fa28 Compare August 5, 2020 13:33
@blakerouse blakerouse requested a review from a team as a code owner August 6, 2020 13:32
Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

LGTM.

@blakerouse blakerouse force-pushed the agent-synthetics-config branch from f082ccf to e35f413 Compare August 6, 2020 17:20
@blakerouse blakerouse merged commit b153044 into elastic:master Aug 6, 2020
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20387 updated]

  • Start Time: 2020-08-06T17:21:37.899+0000

  • Duration: 74 min 13 sec

Test stats 🧪

Test Results
Failed 0
Passed 17821
Skipped 1929
Total 19750

@blakerouse blakerouse deleted the agent-synthetics-config branch August 6, 2020 18:41
blakerouse added a commit to blakerouse/beats that referenced this pull request Aug 6, 2020
…lastic#20387)

* Add support for synthetics inputs that run heartbeat.

* Run mage fmt.

* Add changelog.

* Update test configs to use host instead of hosts.

* Enable support for top-level inputs from Elastic Agent.

(cherry picked from commit b153044)
andrewvc added a commit to andrewvc/beats that referenced this pull request Aug 11, 2020
…artbeat (elastic#20387)"

This was breaking the agent build

This reverts commit b153044.
@andrewvc andrewvc mentioned this pull request Aug 17, 2020
4 tasks
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
…lastic#20387)

* Add support for synthetics inputs that run heartbeat.

* Run mage fmt.

* Add changelog.

* Update test configs to use host instead of hosts.

* Enable support for top-level inputs from Elastic Agent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants