Skip to content

Commit

Permalink
Merge branch 'main' into fix-clean-inactive-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr authored Apr 12, 2024
2 parents cba57bb + e993e09 commit 0d06c5c
Show file tree
Hide file tree
Showing 38 changed files with 656 additions and 147 deletions.
25 changes: 22 additions & 3 deletions .buildkite/metricbeat/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
GCP_WIN_MACHINE_TYPE: "n2-standard-8"

IMAGE_MACOS_ARM: "generic-13-ventura-arm"
IMAGE_MACOS_X86_64: "generic-13-ventura-x64"
IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
Expand Down Expand Up @@ -214,8 +215,8 @@ steps:
key: "metricbeat-extended-macos-tests"
if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/
steps:
- label: ":mac: MacOS Unit Tests"
key: "extended-macos-unit-tests"
- label: ":mac: MacOS x64_64 Unit Tests"
key: "extended-macos-x64-64-unit-tests"
command: |
set -euo pipefail
source .buildkite/scripts/install_macos_tools.sh
Expand All @@ -228,7 +229,25 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended MacOS Unit Tests"
context: "metricbeat: Extended MacOS x86_64 Unit Tests"

- label: ":mac: MacOS arm64 Unit Tests"
key: "extended-macos-arm64-unit-tests"
skip: "due to https://github.com/elastic/beats/issues/33035"
command: |
set -euo pipefail
source .buildkite/scripts/install_macos_tools.sh
cd metricbeat && mage build unitTest
agents:
provider: "orka"
imagePrefix: "${IMAGE_MACOS_ARM}"
artifact_paths:
- "metricbeat/build/*.xml"
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended MacOS arm64 Unit Tests"


- wait: ~
# with PRs, we want to run packaging only if mandatory tests succeed
Expand Down
5 changes: 5 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ steps:
- path:
- auditbeat/
- .buildkite/auditbeat/
- .buildkite/scripts
#OSS
- go.mod
- pytest.ini
Expand All @@ -33,6 +34,7 @@ steps:
- path:
- heartbeat/
- .buildkite/heartbeat/
- .buildkite/scripts
#OSS
- go.mod
- pytest.ini
Expand All @@ -57,6 +59,7 @@ steps:
- path:
- x-pack/dockerlogbeat/
- .buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml
- .buildkite/scripts
#OSS
- go.mod
- pytest.ini
Expand Down Expand Up @@ -106,6 +109,7 @@ steps:
- path:
- x-pack/winlogbeat/
- .buildkite/x-pack/pipeline.xpack.winlogbeat.yml
- .buildkite/scripts
#OSS
- go.mod
- pytest.ini
Expand All @@ -131,6 +135,7 @@ steps:
- .buildkite/deploy/kubernetes/**
- deploy/kubernetes/**
- libbeat/docs/version.asciidoc
- .buildkite/scripts
config:
trigger: "deploy-k8s"
build:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pipelineSlug": "beats",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": [ ],
"allowed_list": [ "mergify[bot]" ],
"set_commit_status": true,
"build_on_commit": true,
"build_on_comment": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,6 @@ CHANGELOG*

# Ownership of CI or related files by the Ingest Eng Prod team
/.buildkite @elastic/ingest-eng-prod
/catalog-info.yml @elastic/ingest-eng-prod
/catalog-info.yaml @elastic/ingest-eng-prod
/libbeat/scripts @elastic/ingest-eng-prod
/metricbeat/tests @elastic/ingest-eng-prod
2 changes: 2 additions & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only.
- Rename `queue.Batch.ACK()` to `queue.Batch.Done()`. {pull}31903[31903]
- `queue.ACKListener` has been removed. Queue configurations now accept an explicit callback function for ACK handling. {pull}35078[35078]
- Split split httpmon out of x-pack/filebeat/input/internal/httplog. {pull}36385[36385]
- Beats publishing pipeline does not propagate the close signal to its clients any more. It's responsibility of the user to close the pipeline client. {issue}38197[38197] {pull}38556[38556]

==== Bugfixes

Expand Down Expand Up @@ -93,6 +94,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only.
- Make winlogbeat/sys/wineventlog follow the unsafe.Pointer rules. {pull}36650[36650]
- Cleaned up documentation errors & fixed a minor bug in Filebeat Azure blob storage input. {pull}36714[36714]
- Fix copy arguments for strict aligned architectures. {pull}36976[36976]
- Fix panic when more than 32767 pipeline clients are active. {issue}38197[38197] {pull}38556[38556]

==== Added

Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Fix filestream's registry GC: registry entries are now removed from the in-memory and disk store when they're older than the set TTL {issue}36761[36761] {pull}38488[38488]
- Fix indexing failures by re-enabling event normalisation in netflow input. {issue}38703[38703] {pull}38780[38780]
- Fix handling of truncated files in Filestream {issue}38070[38070] {pull}38416[38416]
- Fix `clean_removed` on Filestream input. {issue}36761[36761] {pull}38488[38488]
- Fix panic when more than 32767 pipeline clients are active. {issue}38197[38197] {pull}38556[38556]
- Fix filestream's registry GC: registry entries are now removed from the in-memory and disk store when they're older than the set TTL {issue}36761[36761] {pull}38488[38488]
- Fix `clean_inactive` on Filestream input by correctly parsing the value from the configuration yaml {issue}36629[36629] {pull}38632[38632]


*Heartbeat*

Expand Down Expand Up @@ -207,6 +207,8 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Update CEL mito extensions to v1.10.0 to add keys/values helper. {pull}38504[38504]
- Add support for Active Directory an entity analytics provider. {pull}37919[37919]
- Add debugging breadcrumb to logs when writing request trace log. {pull}38636[38636]
- added benchmark input {pull}37437[37437]
- added benchmark input and discard output {pull}37437[37437]

*Auditbeat*

Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24111,11 +24111,11 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp/v

--------------------------------------------------------------------------------
Dependency : go.elastic.co/apm/v2
Version: v2.5.0
Version: v2.6.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.5.0/LICENSE:
Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.6.0/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down
3 changes: 2 additions & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ spec:
name: beats
description: "Beats Main pipeline"
spec:
branch_configuration: "main 7.17 8.* mergify*"
branch_configuration: "main 7.17 8.*"
pipeline_file: ".buildkite/pipeline.yml"
provider_settings:
build_pull_request_forks: false
build_pull_request_labels_changed: true # automatically re trigger build if GH labels change
build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
build_tags: true
filter_enabled: true
Expand Down
3 changes: 3 additions & 0 deletions filebeat/docs/filebeat-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ You can configure {beatname_uc} to use the following inputs:
* <<{beatname_lc}-input-aws-s3>>
* <<{beatname_lc}-input-azure-eventhub>>
* <<{beatname_lc}-input-azure-blob-storage>>
* <<{beatname_lc}-input-benchmark>>
* <<{beatname_lc}-input-cel>>
* <<{beatname_lc}-input-cloudfoundry>>
* <<{beatname_lc}-input-cometd>>
Expand Down Expand Up @@ -104,6 +105,8 @@ include::../../x-pack/filebeat/docs/inputs/input-azure-eventhub.asciidoc[]

include::../../x-pack/filebeat/docs/inputs/input-azure-blob-storage.asciidoc[]

include::../../x-pack/filebeat/docs/inputs/input-benchmark.asciidoc[]

include::../../x-pack/filebeat/docs/inputs/input-cel.asciidoc[]

include::../../x-pack/filebeat/docs/inputs/input-cloudfoundry.asciidoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ func startHarvester(
defer releaseResource(resource)

client, err := hg.pipeline.ConnectWith(beat.ClientConfig{
CloseRef: ctx.Cancelation,
EventListener: newInputACKHandler(hg.ackCH),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/kafka/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ func (input *kafkaInput) Run(ctx input.Context, pipeline beat.Pipeline) error {
}
}),
),
CloseRef: ctx.Cancelation,
WaitClose: input.config.WaitClose,
})
if err != nil {
return err
}
defer client.Close()

log.Info("Starting Kafka input")
defer log.Info("Kafka input stopped")
Expand Down
1 change: 0 additions & 1 deletion filebeat/input/v2/input-cursor/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func (inp *managedInput) runSource(
}()

client, err := pipeline.ConnectWith(beat.ClientConfig{
CloseRef: ctx.Cancelation,
EventListener: newInputACKHandler(ctx.Logger),
})
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions filebeat/input/v2/input-stateless/stateless.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ func (si configuredInput) Run(ctx v2.Context, pipeline beat.PipelineConnector) (

client, err := pipeline.ConnectWith(beat.ClientConfig{
PublishMode: beat.DefaultGuarantees,

// configure pipeline to disconnect input on stop signal.
CloseRef: ctx.Cancelation,
})
if err != nil {
return err
Expand Down
9 changes: 5 additions & 4 deletions filebeat/input/v2/input-stateless/stateless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,23 @@ func TestStateless_Run(t *testing.T) {
},
}), nil)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

// connector creates a client the blocks forever until the shutdown signal is received
var publishCalls atomic.Int
connector := pubtest.FakeConnector{
ConnectFunc: func(config beat.ClientConfig) (beat.Client, error) {
return &pubtest.FakeClient{
PublishFunc: func(event beat.Event) {
publishCalls.Inc()
<-config.CloseRef.Done()
// Unlock Publish once the input has been cancelled
<-ctx.Done()
},
}, nil
},
}

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

var wg sync.WaitGroup
var err error
wg.Add(1)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ require (
github.com/tklauser/go-sysconf v0.3.10
go.elastic.co/apm/module/apmelasticsearch/v2 v2.4.8
go.elastic.co/apm/module/apmhttp/v2 v2.5.0
go.elastic.co/apm/v2 v2.5.0
go.elastic.co/apm/v2 v2.6.0
go.mongodb.org/mongo-driver v1.5.1
golang.org/x/exp v0.0.0-20231127185646-65229373498e
golang.org/x/tools/go/vcs v0.1.0-deprecated
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1954,8 +1954,8 @@ go.elastic.co/apm/module/apmelasticsearch/v2 v2.4.8 h1:4j3wI1e+WV6u+9ZR7lorkJI2r
go.elastic.co/apm/module/apmelasticsearch/v2 v2.4.8/go.mod h1:C9ajbSjZ3akTrFOjBr+pMq8bPVOH9vhIG+knZAuPW3s=
go.elastic.co/apm/module/apmhttp/v2 v2.5.0 h1:4AWlw8giL7hRYBQiwF1/Thm0GDsbQH/Ofe4eySAnURo=
go.elastic.co/apm/module/apmhttp/v2 v2.5.0/go.mod h1:ZP7gLEzY/OAPTqNZjp8AzA06HF82zfwXEpKI2sSVTgk=
go.elastic.co/apm/v2 v2.5.0 h1:UYqdu/bjcubcP9BIy5+os2ExRzw03yOQFG+sRGGhVlQ=
go.elastic.co/apm/v2 v2.5.0/go.mod h1:+CiBUdrrAGnGCL9TNx7tQz3BrfYV23L8Ljvotoc87so=
go.elastic.co/apm/v2 v2.6.0 h1:VieBMLQFtXua2YxpYxaSdYGnmmxhLT46gosI5yErJgY=
go.elastic.co/apm/v2 v2.6.0/go.mod h1:33rOXgtHwbgZcDgi6I/GtCSMZQqgxkHC0IQT3gudKvo=
go.elastic.co/ecszap v1.0.2 h1:iW5OGx8IiokiUzx/shD4AJCPFMC9uUtr7ycaiEIU++I=
go.elastic.co/ecszap v1.0.2/go.mod h1:dJkSlK3BTiwG/qXhCwe50Mz/jwu854vSip8sIeQhNZg=
go.elastic.co/fastjson v1.1.0 h1:3MrGBWWVIxe/xvsbpghtkFoPciPhOCmjsR/HfwEeQR4=
Expand Down
9 changes: 0 additions & 9 deletions libbeat/beat/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ type ClientConfig struct {

Processing ProcessingConfig

CloseRef CloseRef

// WaitClose sets the maximum duration to wait on ACK, if client still has events
// active non-acknowledged events in the publisher pipeline.
// WaitClose is only effective if one of ACKCount, ACKEvents and ACKLastEvents
Expand Down Expand Up @@ -91,13 +89,6 @@ type EventListener interface {
ClientClosed()
}

// CloseRef allows users to close the client asynchronously.
// A CloseRef implements a subset of function required for context.Context.
type CloseRef interface {
Done() <-chan struct{}
Err() error
}

// ProcessingConfig provides additional event processing settings a client can
// pass to the publisher pipeline on Connect.
type ProcessingConfig struct {
Expand Down
10 changes: 10 additions & 0 deletions libbeat/docs/outputs-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ endif::[]
ifndef::no_console_output[]
* <<console-output>>
endif::[]
ifndef::no_discard_output[]
* <<discard-output>>
endif::[]

//# end::outputs-list[]

Expand Down Expand Up @@ -77,6 +80,13 @@ endif::[]
include::{libbeat-outputs-dir}/console/docs/console.asciidoc[]
endif::[]

ifndef::no_discard_output[]
ifdef::requires_xpack[]
[role="xpack"]
endif::[]
include::{libbeat-outputs-dir}/discard/docs/discard.asciidoc[]
endif::[]

ifndef::no_codec[]
ifdef::requires_xpack[]
[role="xpack"]
Expand Down
30 changes: 30 additions & 0 deletions libbeat/outputs/discard/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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.

package discard

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

type discardOutConfig struct {
Queue config.Namespace `config:"queue"`
}

func defaultConfig() discardOutConfig {
return discardOutConfig{}
}
Loading

0 comments on commit 0d06c5c

Please sign in to comment.