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

Add new agentbeat with all beats shipped with Elastic Agent as a single beat #38183

Merged
merged 27 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7b5d784
Add new agentbeat.
blakerouse Mar 4, 2024
3cc5471
Merge remote-tracking branch 'upstream/main' into agentbeat
blakerouse Mar 4, 2024
19eead4
Fix auditbeat test.
blakerouse Mar 4, 2024
ee5310c
Fix imports.
blakerouse Mar 4, 2024
3350b24
Fix moduleName in audit/system/package.
blakerouse Mar 5, 2024
c17068c
Fix imports on osquerybeat.
blakerouse Mar 5, 2024
777e720
Add agentbeat.spec.yml.
blakerouse Mar 5, 2024
2a3f1d5
Adjust metrics registration to not collide.
blakerouse Apr 4, 2024
a108161
Merge branch 'main' into agentbeat
blakerouse Apr 4, 2024
14bcf16
Fix issue with management.ConfigTransform.SetTransform.
blakerouse Apr 4, 2024
3605950
Fix lint in metricbeat.
blakerouse Apr 4, 2024
8221cb4
Merge remote-tracking branch 'upstream/main' into agentbeat
blakerouse Apr 4, 2024
01840af
Merge remote-tracking branch 'upstream/main' into agentbeat
blakerouse Apr 5, 2024
116c9bc
Work on enabling system tests.
blakerouse Apr 8, 2024
6643c76
Add go integration tests for agentbeat.
blakerouse Apr 9, 2024
2ba6dec
Fix imports.
blakerouse Apr 9, 2024
4d0b8b6
Fix kubernetes provider to work with agentbeat.
blakerouse Apr 10, 2024
9f2e860
Adjustments for auditbeat.
blakerouse Apr 10, 2024
a8164a2
Adjust auditbeat.
blakerouse Apr 10, 2024
80075fa
Adjust initialization.
blakerouse Apr 11, 2024
8447872
More cleanup.
blakerouse Apr 11, 2024
10f58fc
Merge branch 'main' into agentbeat
blakerouse Apr 11, 2024
88c8fcc
More adjustments.
blakerouse Apr 11, 2024
466b2b4
Fix auditbeat show command.
blakerouse Apr 11, 2024
94a7ab4
Fix include list.
blakerouse Apr 11, 2024
bdc194c
Fix auditbeat login test.
blakerouse Apr 11, 2024
9edf3ac
More auditbeat test fixes.
blakerouse Apr 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions filebeat/fileset/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ import (

var moduleList = monitoring.NewUniqueList()

func init() {
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "module", moduleList.Report, monitoring.Report)
}

// Factory for modules
type Factory struct {
beatInfo beat.Info
Expand Down
28 changes: 28 additions & 0 deletions filebeat/fileset/factory_init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build !agentbeat

package fileset

import (
"github.com/elastic/elastic-agent-libs/monitoring"
)

func init() {
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "module", moduleList.Report, monitoring.Report)
}
28 changes: 28 additions & 0 deletions filebeat/fileset/factory_init_agent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build agentbeat

package fileset

import (
"github.com/elastic/elastic-agent-libs/monitoring"
)

func init() {
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "filebeat_module", moduleList.Report, monitoring.Report)
}
4 changes: 0 additions & 4 deletions filebeat/input/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ import (

var inputList = monitoring.NewUniqueList()

func init() {
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "input", inputList.Report, monitoring.Report)
}

// Input is the interface common to all input
type Input interface {
Run()
Expand Down
26 changes: 26 additions & 0 deletions filebeat/input/input_init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build !agentbeat

package input

import "github.com/elastic/elastic-agent-libs/monitoring"

func init() {
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "input", inputList.Report, monitoring.Report)
}
26 changes: 26 additions & 0 deletions filebeat/input/input_init_agent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build agentbeat

package input

import "github.com/elastic/elastic-agent-libs/monitoring"

func init() {
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "filebeat_input", inputList.Report, monitoring.Report)
}
5 changes: 0 additions & 5 deletions metricbeat/mb/module/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ var (
moduleList *monitoring.UniqueList
)

func init() {
moduleList = monitoring.NewUniqueList()
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "module", moduleList.Report, monitoring.Report)
}

// Runner is a facade for a Wrapper that provides a simple interface
// for starting and stopping a Module.
type Runner interface {
Expand Down
29 changes: 29 additions & 0 deletions metricbeat/mb/module/runner_init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build !agentbeat

package module

import (
"github.com/elastic/elastic-agent-libs/monitoring"
)

func init() {
moduleList = monitoring.NewUniqueList()
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "module", moduleList.Report, monitoring.Report)
}
29 changes: 29 additions & 0 deletions metricbeat/mb/module/runner_init_agent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build agentbeat

package module

import (
"github.com/elastic/elastic-agent-libs/monitoring"
)

func init() {
moduleList = monitoring.NewUniqueList()
monitoring.NewFunc(monitoring.GetNamespace("state").GetRegistry(), "metricbeat_module", moduleList.Report, monitoring.Report)
}
14 changes: 9 additions & 5 deletions packetbeat/scripts/mage/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ import (
// GolangCrossBuild build the Beat binary inside of the golang-builder.
// Do not use directly, use crossBuild instead.
func GolangCrossBuild() error {
return multierr.Combine(
devtools.GolangCrossBuild(GolangCrossBuildArgs()),
devtools.TestLinuxForCentosGLIBC(),
)
}

// GolangCrossBuildArgs returns the correct build arguments for golang-crossbuild.
func GolangCrossBuildArgs() devtools.BuildArgs {
params := devtools.DefaultGolangCrossBuildArgs()
if flags, found := libpcapLDFLAGS[devtools.Platform.Name]; found {
params.Env = map[string]string{
Expand All @@ -35,11 +43,7 @@ func GolangCrossBuild() error {
if flags, found := libpcapCFLAGS[devtools.Platform.Name]; found {
params.Env["CGO_CFLAGS"] = flags
}

return multierr.Combine(
devtools.GolangCrossBuild(params),
devtools.TestLinuxForCentosGLIBC(),
)
return params
}

// -----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions x-pack/agentbeat/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ES_BEATS ?= ../..

include $(ES_BEATS)/dev-tools/make/mage.mk
Loading
Loading