forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Elastic Agent] Add support for synthetics inputs that run heartbeat (e…
…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.
- Loading branch information
1 parent
6fabb86
commit b153044
Showing
23 changed files
with
175 additions
and
78 deletions.
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.