-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
+175
−78
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f30867a
Add support for synthetics inputs that run heartbeat.
blakerouse 342f6ab
Run mage fmt.
blakerouse d128553
Add changelog.
blakerouse c7b1812
Update test configs to use host instead of hosts.
blakerouse e35f413
Enable support for top-level inputs from Elastic Agent.
blakerouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ output: | |
|
||
inputs: | ||
- id: endpoint-id | ||
type: endpoint | ||
name: endpoint-1 | ||
enabled: true | ||
package: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ outputs: | |
|
||
inputs: | ||
- id: endpoint-id | ||
type: endpoint | ||
name: endpoint-1 | ||
enabled: true | ||
package: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ outputs: | |
|
||
inputs: | ||
- id: endpoint-id | ||
type: endpoint | ||
name: endpoint-1 | ||
enabled: true | ||
package: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ outputs: | |
|
||
inputs: | ||
- id: endpoint-id | ||
type: endpoint | ||
name: endpoint-1 | ||
enabled: true | ||
package: | ||
|
18 changes: 0 additions & 18 deletions
18
x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config-heartbeat.yml
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ output: | |
|
||
inputs: | ||
- id: endpoint-id | ||
type: endpoint | ||
name: endpoint-1 | ||
enabled: true | ||
package: | ||
|
18 changes: 18 additions & 0 deletions
18
x-pack/elastic-agent/pkg/agent/program/testdata/single_config-heartbeat.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
inputs: | ||
- type: synthetics/http | ||
id: unique-http-id | ||
name: my-http | ||
schedule: '*/5 * * * * * *' | ||
host: "http://localhost:80/service/status" | ||
timeout: 16s | ||
wait: 1s | ||
dataset.namespace: default | ||
output: | ||
elasticsearch: | ||
hosts: | ||
- 127.0.0.1:9200 | ||
- 127.0.0.1:9300 | ||
username: elastic | ||
password: changeme | ||
api_key: TiNAGG4BaaMdaH1tRfuU:KnR6yE41RrSowb0kQ0HWoA | ||
ca_sha256: 7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/elastic-agent/pkg/agent/program/testdata/synthetics_config-heartbeat.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
inputs: | ||
- type: synthetics/http | ||
id: unique-http-id | ||
name: my-http | ||
schedule: '*/5 * * * * * *' | ||
host: "http://localhost:80/service/status" | ||
timeout: 16s | ||
wait: 1s | ||
dataset.namespace: default | ||
- type: synthetics/tcp | ||
id: unique-tcp-id | ||
name: my-tcp | ||
schedule: '*/5 * * * * * *' | ||
host: "localhost:777" | ||
timeout: 16s | ||
wait: 1s | ||
dataset.namespace: default | ||
- type: synthetics/icmp | ||
id: unique-icmp-id | ||
name: my-icmp | ||
schedule: '@every 5s' | ||
host: "localhost" | ||
ipv4: true | ||
ipv6: true | ||
mode: any | ||
timeout: 16s | ||
wait: 1s | ||
dataset.namespace: default | ||
output: | ||
elasticsearch: | ||
hosts: [127.0.0.1:9200, 127.0.0.1:9300] | ||
username: elastic | ||
password: changeme |
31 changes: 31 additions & 0 deletions
31
x-pack/elastic-agent/pkg/agent/program/testdata/synthetics_config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
inputs: | ||
- type: synthetics/http | ||
id: unique-http-id | ||
name: my-http | ||
schedule: '*/5 * * * * * *' | ||
host: "http://localhost:80/service/status" | ||
timeout: 16s | ||
wait: 1s | ||
- type: synthetics/tcp | ||
id: unique-tcp-id | ||
name: my-tcp | ||
schedule: '*/5 * * * * * *' | ||
host: "localhost:777" | ||
timeout: 16s | ||
wait: 1s | ||
- type: synthetics/icmp | ||
id: unique-icmp-id | ||
name: my-icmp | ||
schedule: '@every 5s' | ||
host: "localhost" | ||
ipv4: true | ||
ipv6: true | ||
mode: any | ||
timeout: 16s | ||
wait: 1s | ||
outputs: | ||
default: | ||
type: elasticsearch | ||
hosts: [127.0.0.1:9200, 127.0.0.1:9300] | ||
username: elastic | ||
password: changeme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Heartbeat | ||
cmd: heartbeat | ||
args: ["-E", "setup.ilm.enabled=false", "-E", "setup.template.enabled=false", "-E", "management.mode=x-pack-fleet", "-E", "management.enabled=true", "-E", "logging.level=debug"] | ||
artifact: beats/heartbeat | ||
rules: | ||
- fix_stream: {} | ||
- filter_values_with_regexp: | ||
key: type | ||
re: ^synthetics/.+ | ||
selector: inputs | ||
- filter_values: | ||
selector: inputs | ||
key: enabled | ||
values: | ||
- true | ||
- filter: | ||
selectors: | ||
- inputs | ||
- output | ||
- keystore | ||
when: HasItems(%{[inputs]}) && HasNamespace('output', 'elasticsearch', 'redis', | ||
'kafka', 'logstash') |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ofx-pack/elastic-agent
to build Elastic Agent when heartbeat bundled. Which you want to do to easy testing.There was a problem hiding this comment.
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.