Skip to content

Commit

Permalink
Revert "[Elastic Agent] Add support for synthetics inputs that run he…
Browse files Browse the repository at this point in the history
…artbeat (elastic#20387)"

This was breaking the agent build

This reverts commit b153044.
  • Loading branch information
andrewvc committed Aug 11, 2020
1 parent d036955 commit 68e87b4
Show file tree
Hide file tree
Showing 23 changed files with 78 additions and 175 deletions.
41 changes: 0 additions & 41 deletions dev-tools/packaging/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ shared:
source: '{{.AgentDropPath}}/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc'
mode: 0644
skip_on_missing: true
/var/lib/{{.BeatName}}/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz:
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz'
mode: 0644
/var/lib/{{.BeatName}}/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.sha512:
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.sha512'
mode: 0644
/var/lib/{{.BeatName}}/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc:
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc'
mode: 0644
skip_on_missing: true
/var/lib/{{.BeatName}}/downloads/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz:
source: '{{.AgentDropPath}}/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz'
mode: 0644
Expand Down Expand Up @@ -145,17 +135,6 @@ shared:
source: '{{.AgentDropPath}}/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc'
mode: 0644
skip_on_missing: true
/etc/{{.BeatName}}/data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz:
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz'
mode: 0644
/etc/{{.BeatName}}/data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.sha512:
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.sha512'
mode: 0644
skip_on_missing: true
/etc/{{.BeatName}}/data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc:
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc'
mode: 0644
skip_on_missing: true
/etc/{{.BeatName}}/data/downloads/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz:
source: '{{.AgentDropPath}}/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz'
mode: 0644
Expand Down Expand Up @@ -216,16 +195,6 @@ shared:
source: '{{.AgentDropPath}}/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc'
mode: 0644
skip_on_missing: true
'data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz':
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz'
mode: 0644
'data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.sha512':
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.sha512'
mode: 0644
'data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc':
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz.asc'
mode: 0644
skip_on_missing: true
'data/downloads/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz':
source: '{{.AgentDropPath}}/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz'
mode: 0644
Expand Down Expand Up @@ -270,16 +239,6 @@ shared:
source: '{{.AgentDropPath}}/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip.asc'
mode: 0644
skip_on_missing: true
'data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip':
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip'
mode: 0644
'data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip.sha512':
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip.sha512'
mode: 0644
'data/downloads/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip.asc':
source: '{{.AgentDropPath}}/heartbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip.asc'
mode: 0644
skip_on_missing: true
'data/downloads/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip':
source: '{{.AgentDropPath}}/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.zip'
mode: 0644
Expand Down
2 changes: 0 additions & 2 deletions heartbeat/beater/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ func (bt *Heartbeat) RunStaticMonitors(b *beat.Beat) error {
func (bt *Heartbeat) RunCentralMgmtMonitors(b *beat.Beat) {
monitors := cfgfile.NewRunnerList(management.DebugK, bt.dynamicFactory, b.Publisher)
reload.Register.MustRegisterList(b.Info.Beat+".monitors", monitors)
inputs := cfgfile.NewRunnerList(management.DebugK, bt.dynamicFactory, b.Publisher)
reload.Register.MustRegisterList("inputs", inputs)
}

// RunReloadableMonitors runs the `heartbeat.config.monitors` portion of the yaml config if present.
Expand Down
1 change: 0 additions & 1 deletion heartbeat/monitors/active/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (

func init() {
monitors.RegisterActive("http", create)
monitors.RegisterActive("synthetics/http", create)
}

var debugf = logp.MakeDebug("http")
Expand Down
1 change: 0 additions & 1 deletion heartbeat/monitors/active/icmp/icmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var debugf = logp.MakeDebug("icmp")

func init() {
monitors.RegisterActive("icmp", create)
monitors.RegisterActive("synthetics/icmp", create)
}

func create(
Expand Down
1 change: 0 additions & 1 deletion heartbeat/monitors/active/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (

func init() {
monitors.RegisterActive("tcp", create)
monitors.RegisterActive("synthetics/tcp", create)
}

var debugf = logp.MakeDebug("tcp")
Expand Down
1 change: 0 additions & 1 deletion x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,3 @@
- Improved version CLI {pull}20359[20359]
- Enroll CLI now restarts running daemon {pull}20359[20359]
- Add restart CLI cmd {pull}20359[20359]
- Add new `synthetics/*` inputs to run Heartbeat {pull}20387[20387]
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func packageAgent(requiredPackages []string, packagingFn func()) {
defer os.RemoveAll(dropPath)
defer os.Unsetenv(agentDropPath)

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

for _, b := range packedBeats {
pwd, err := filepath.Abs(filepath.Join("..", b))
Expand Down
12 changes: 6 additions & 6 deletions x-pack/elastic-agent/pkg/agent/program/program_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ func TestConfiguration(t *testing.T) {
err bool
}{
"single_config": {
programs: []string{"filebeat", "heartbeat", "metricbeat", "endpoint"},
expected: 4,
programs: []string{"filebeat", "metricbeat", "endpoint"},
expected: 3,
},
"constraints_config": {
programs: []string{"filebeat"},
Expand All @@ -400,10 +400,10 @@ func TestConfiguration(t *testing.T) {
// programs: []string{"journalbeat"},
// expected: 1,
// },
"synthetics_config": {
programs: []string{"heartbeat"},
expected: 1,
},
// "monitor_config": {
// programs: []string{"heartbeat"},
// expected: 1,
// },
"enabled_true": {
programs: []string{"filebeat"},
expected: 1,
Expand Down
3 changes: 1 addition & 2 deletions x-pack/elastic-agent/pkg/agent/program/supported.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ output:

inputs:
- id: endpoint-id
type: endpoint
name: endpoint-1
enabled: true
package:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ outputs:

inputs:
- id: endpoint-id
type: endpoint
name: endpoint-1
enabled: true
package:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ outputs:

inputs:
- id: endpoint-id
type: endpoint
name: endpoint-1
enabled: true
package:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ outputs:

inputs:
- id: endpoint-id
type: endpoint
name: endpoint-1
enabled: true
package:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
heartbeat:
monitors:
- type: icmp
name: icmp
schedule: "*/5 * * * * * *"
hosts: ["localhost"]
ipv4: true
ipv6: true
mode: any
timeout: 16s
wait: 1s
- type: tcp
name: tcp
output:
elasticsearch:
hosts: [127.0.0.1:9200, 127.0.0.1:9300]
username: elastic
password: changeme
23 changes: 23 additions & 0 deletions x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
streams:
- type: monitor/icmp
name: icmp
schedule: '*/5 * * * * * *'
hosts: ["localhost"]
ipv4: true
ipv6: true
mode: any
timeout: 16s
wait: 1s
- type: log/file
- type: monitor/tcp
name: tcp
management:
host: "localhost"
config:
reload: 123
outputs:
default:
type: elasticsearch
hosts: [127.0.0.1:9200, 127.0.0.1:9300]
username: elastic
password: changeme
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ output:

inputs:
- id: endpoint-id
type: endpoint
name: endpoint-1
enabled: true
package:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,7 @@ inputs:
metricset: info
hosts: ["http://apache.remote"]
hosts: ["http://apache.local"]
- type: synthetics/http
id: unique-http-id
name: my-http
schedule: '*/5 * * * * * *'
host: "http://localhost:80/service/status"
timeout: 16s
wait: 1s
- id: endpoint-id
type: endpoint
name: endpoint-1
enabled: true
package:
Expand Down

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions x-pack/elastic-agent/pkg/agent/transpiler/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ func (r *FilterValuesWithRegexpRule) Apply(ast *AST) error {

newAST, ok := Lookup(newRoot, r.Key)
if !ok {
// doesn't have key so its filtered out
newNodes = append(newNodes, item)
continue
}

Expand All @@ -1210,7 +1210,7 @@ func (r *FilterValuesWithRegexpRule) Apply(ast *AST) error {
}

if n.name != r.Key {
// doesn't match so its filtered out
newNodes = append(newNodes, item)
continue
}

Expand Down
22 changes: 0 additions & 22 deletions x-pack/elastic-agent/spec/heartbeat.yml

This file was deleted.

Loading

0 comments on commit 68e87b4

Please sign in to comment.