Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
59d3e2e
add otel test binary
khushijain21 Jun 9, 2025
bb6ef5e
improve collector framework
khushijain21 Jun 9, 2025
188bd7c
get es client and framework improvement
khushijain21 Jun 9, 2025
6e3780a
otel e2e test works
khushijain21 Jun 9, 2025
b897c9d
address review comments
khushijain21 Jun 12, 2025
ac6aa52
Merge branch 'main' into oteltestbinary
khushijain21 Jun 12, 2025
7b4e809
refactor paths
khushijain21 Jun 12, 2025
4a6c2eb
check update
khushijain21 Jun 12, 2025
4fca789
check update
khushijain21 Jun 12, 2025
4204da4
Merge branch 'main' into oteltestbinary
khushijain21 Jun 12, 2025
c4e3afe
Update libbeat/tests/integration/framework.go
khushijain21 Jun 12, 2025
85042a8
Update libbeat/tests/integration/framework.go
khushijain21 Jun 12, 2025
4d76a26
Merge branch 'main' into oteltestbinary
khushijain21 Jun 12, 2025
7065f2a
increase timeout
khushijain21 Jun 12, 2025
3d9a15a
add collector wait method
khushijain21 Jun 16, 2025
dcc16f1
Merge branch 'main' into oteltestbinary
khushijain21 Jun 16, 2025
8504982
add verbose error logging
khushijain21 Jun 16, 2025
c06f914
change context background
khushijain21 Jun 16, 2025
a48f4f8
add logs
khushijain21 Jun 16, 2025
d98b134
add logs
khushijain21 Jun 16, 2025
93fb778
remove home
khushijain21 Jun 16, 2025
0735ac7
Merge branch 'main' into oteltestbinary
khushijain21 Jun 16, 2025
59a66b5
changed getESCLient
khushijain21 Jun 16, 2025
ee0e1ab
Merge branch 'main' into oteltestbinary
khushijain21 Jun 16, 2025
8535993
use previous test file + GetESClient
khushijain21 Jun 17, 2025
e1dfc18
add error
khushijain21 Jun 17, 2025
4effb73
Merge branch 'main' into oteltestbinary
khushijain21 Jun 17, 2025
1866a4b
use previous client
khushijain21 Jun 17, 2025
3d268e2
change v7 to v8
khushijain21 Jun 17, 2025
b0c49ff
remove err
khushijain21 Jun 17, 2025
80eb9d1
add new collector
khushijain21 Jun 17, 2025
23e8497
add otelbeat binary
khushijain21 Jun 17, 2025
e37dbea
fix pipeline step
khushijain21 Jun 17, 2025
2a3e3c7
Merge branch 'main' into otelbeat.test
khushijain21 Jun 17, 2025
c42990a
remove unnecessary code
khushijain21 Jun 17, 2025
517b486
add mage command
khushijain21 Jun 17, 2025
d4c9204
add otel integ test
khushijain21 Jun 17, 2025
6c52aa6
Update .buildkite/x-pack/pipeline.xpack.filebeat.yml
khushijain21 Jun 17, 2025
64a035a
Remove extra stage - compile otel binary with integ test
khushijain21 Jun 18, 2025
69ddc0c
Merge branch 'main' into otelbeat.test
khushijain21 Jun 18, 2025
38202d5
add otel test binary for fips too
khushijain21 Jun 18, 2025
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
7 changes: 7 additions & 0 deletions dev-tools/mage/gotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,13 @@ func BuildSystemTestBinary() error {
return BuildSystemTestGoBinary(DefaultTestBinaryArgs())
}

// BuildSystemTestOTelBinary builds beat binary that includes otel.
func BuildSystemTestOTelBinary() error {
args := DefaultTestBinaryArgs()
args.ExtraFlags = []string{"-tags", "otelbeat"}
return BuildSystemTestGoBinary(args)
}

// BuildSystemTestGoBinary build a binary for testing that is instrumented for
// testing and measuring code coverage. The binary is only instrumented for
// coverage when TEST_COVERAGE=true (default is false).
Expand Down
44 changes: 0 additions & 44 deletions x-pack/filebeat/cmd/otel_test.go

This file was deleted.

15 changes: 15 additions & 0 deletions x-pack/filebeat/cmd/otelcmd_disabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !otelbeat

package cmd

import (
cmd "github.com/elastic/beats/v7/libbeat/cmd"
)

func addOTelCommand(command *cmd.BeatsRootCmd) {
// No-op
}
17 changes: 17 additions & 0 deletions x-pack/filebeat/cmd/otelcmd_enabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build otelbeat

package cmd

import (
fbcmd "github.com/elastic/beats/v7/filebeat/cmd"
cmd "github.com/elastic/beats/v7/libbeat/cmd"
"github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat"
)

func addOTelCommand(command *cmd.BeatsRootCmd) {
command.AddCommand(otelbeat.OTelCmd(fbcmd.Name))
}
3 changes: 1 addition & 2 deletions x-pack/filebeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/elastic/beats/v7/libbeat/publisher/processing"
"github.com/elastic/beats/v7/x-pack/filebeat/include"
inputs "github.com/elastic/beats/v7/x-pack/filebeat/input/default-inputs"
"github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat"
"github.com/elastic/beats/v7/x-pack/libbeat/management"

// Register the includes.
Expand All @@ -41,7 +40,7 @@ func Filebeat() *cmd.BeatsRootCmd {
command.PersistentPreRun = func(cmd *cobra.Command, args []string) {
management.ConfigTransform.SetTransform(filebeatCfg)
}
command.AddCommand(otelbeat.OTelCmd(fbcmd.Name))
addOTelCommand(command)
return command
}

Expand Down
13 changes: 11 additions & 2 deletions x-pack/filebeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ func Build() error {
return devtools.Build(devtools.DefaultBuildArgs())
}

// BuildOTel builds the Beat binary with OTel sub command
func BuildOTel() error {
args := devtools.DefaultBuildArgs()
args.ExtraFlags = append(args.ExtraFlags, "-tags", "otelbeat")
return devtools.Build(args)
}

// BuildSystemTestBinary builds a binary instrumented for use with Python system tests.
func BuildSystemTestBinary() error {
return devtools.BuildSystemTestBinary()
Expand Down Expand Up @@ -168,13 +175,15 @@ func IntegTest() {

// GoIntegTest starts the docker containers and executes the Go integration tests.
func GoIntegTest(ctx context.Context) error {
mg.Deps(BuildSystemTestBinary)
// build integration test binary with otel sub command
devtools.BuildSystemTestOTelBinary()
return devtools.GoIntegTestFromHost(ctx, devtools.DefaultGoTestIntegrationFromHostArgs())
}

// GoFIPSOnlyIntegTest starts the docker containers and executes the Go integration tests with GODEBUG=fips140=only set.
func GoFIPSOnlyIntegTest(ctx context.Context) error {
mg.Deps(BuildSystemTestBinary)
// build integration test binary with otel sub command
devtools.BuildSystemTestOTelBinary()
return devtools.GoIntegTestFromHost(ctx, devtools.FIPSOnlyGoTestIntegrationFromHostArgs())
}

Expand Down