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

Update Beats to the current Sarama fork #41655

Merged
merged 38 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5364073
resolve conflict
khushijain21 Nov 18, 2024
cc3530e
Merge branch 'main' into kafka
khushijain21 Nov 19, 2024
291d008
point to elastic sarama fork directly
khushijain21 Nov 20, 2024
bcfbf51
remove dependency on shopify
khushijain21 Nov 20, 2024
37e83bb
linting issues
khushijain21 Nov 20, 2024
e1579e6
linint issues 2
khushijain21 Nov 20, 2024
e1396ac
Merge branch 'main' into kafka
khushijain21 Nov 20, 2024
05989d1
fixed wrapped errors lining
khushijain21 Nov 21, 2024
7b68d68
CI failures
khushijain21 Nov 21, 2024
550613a
ignore error messages in integration tests
khushijain21 Nov 21, 2024
85c0cd7
import paths
khushijain21 Nov 21, 2024
12d7be5
correct elastic import path
khushijain21 Nov 21, 2024
8b3a6b5
import path
khushijain21 Nov 21, 2024
76b93ad
add next valid versions
khushijain21 Nov 21, 2024
610d4d1
revert
khushijain21 Nov 21, 2024
7b94368
revert
khushijain21 Nov 21, 2024
9a446c8
revert
khushijain21 Nov 21, 2024
55552b8
fix failing intergation tests
khushijain21 Nov 22, 2024
93b7c07
fix failing test
khushijain21 Nov 22, 2024
b257dc7
Merge remote-tracking branch 'upstream/main' into kafka
khushijain21 Nov 22, 2024
3c6ea31
upgrade kafka version for testing
khushijain21 Nov 22, 2024
fc94087
using 2.2.2 kafka version
khushijain21 Nov 22, 2024
7db64c9
startConsumergroup
khushijain21 Nov 22, 2024
e7deb67
consumergroup
khushijain21 Nov 22, 2024
ba7e70c
add IBM/sarama methods for consumerinteg
khushijain21 Nov 22, 2024
b812afe
Merge remote-tracking branch 'upstream/main' into kafka
khushijain21 Nov 22, 2024
675a960
linter errors
khushijain21 Nov 22, 2024
2377aed
consumer group with IBM/sarama
khushijain21 Nov 25, 2024
c629f29
Merge remote-tracking branch 'upstream/main' into kafka
khushijain21 Nov 25, 2024
011f56e
Merge remote-tracking branch 'upstream/main' into kafka
khushijain21 Nov 28, 2024
a6b90ac
final changes
khushijain21 Nov 28, 2024
21f710b
update version in consumer group
khushijain21 Nov 28, 2024
514e2fa
Merge remote-tracking branch 'upstream/main' into kafka
khushijain21 Nov 28, 2024
5d2fdc7
fix go.sum after merge
khushijain21 Nov 28, 2024
89ef7a8
add nolint
khushijain21 Nov 28, 2024
3e43a7b
add explanation
khushijain21 Nov 28, 2024
46535f3
Merge remote-tracking branch 'upstream/main' into kafka
khushijain21 Nov 29, 2024
6a002b1
use elastic fork instead of shopify
khushijain21 Nov 29, 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
222 changes: 80 additions & 142 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2745,36 +2745,6 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/elastic/sarama
Version: v1.19.1-0.20220310193331-ebc2b0d8eef3
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE:

Copyright (c) 2013 Shopify

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/StackExchange/wmi
Version: v1.2.1
Expand Down Expand Up @@ -10159,38 +10129,6 @@ THE SOFTWARE.



--------------------------------------------------------------------------------
Dependency : github.com/bsm/sarama-cluster
Version: v2.1.14-0.20180625083203-7e67d87a6b3f+incompatible
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/bsm/[email protected]+incompatible/LICENSE:

(The MIT License)

Copyright (c) 2017 Black Square Media Ltd

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/cavaliergopher/rpm
Version: v1.2.0
Expand Down Expand Up @@ -12880,11 +12818,11 @@ SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/eapache/go-resiliency
Version: v1.2.0
Version: v1.7.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/eapache/go-resiliency@v1.2.0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/eapache/go-resiliency@v1.7.0/LICENSE:

The MIT License (MIT)

Expand Down Expand Up @@ -16704,6 +16642,40 @@ See the License for the specific language governing permissions and
limitations under the License.


--------------------------------------------------------------------------------
Dependency : github.com/elastic/sarama
Version: v1.19.1-0.20241120141909-c7eabfcee7e5
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.md:

# MIT License

Copyright (c) 2013 Shopify

Copyright (c) 2023 IBM Corporation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/elastic/tk-btf
Version: v0.1.0
Expand Down Expand Up @@ -20799,11 +20771,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : github.com/jcmturner/gokrb5/v8
Version: v8.4.2
Version: v8.4.4
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gokrb5/[email protected].2/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gokrb5/[email protected].4/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -33135,6 +33107,40 @@ Contents of probable licence file $GOMODCACHE/github.com/!azure!a!d/microsoft-au
SOFTWARE


--------------------------------------------------------------------------------
Dependency : github.com/IBM/sarama
Version: v1.43.3
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/!i!b!m/[email protected]/LICENSE.md:

# MIT License

Copyright (c) 2013 Shopify

Copyright (c) 2023 IBM Corporation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/JohnCGriffin/overflow
Version: v0.0.0-20211019200055-46fa312c352c
Expand Down Expand Up @@ -33172,38 +33178,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/Shopify/toxiproxy
Version: v2.1.4+incompatible
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/!shopify/[email protected]+incompatible/LICENSE:

The MIT License (MIT)

Copyright (c) 2014 Shopify

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



--------------------------------------------------------------------------------
Dependency : github.com/akavel/rsrc
Version: v0.8.0
Expand Down Expand Up @@ -39444,11 +39418,11 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/[email protected].

--------------------------------------------------------------------------------
Dependency : github.com/eapache/go-xerial-snappy
Version: v0.0.0-20180814174437-776d5712da21
Version: v0.0.0-20230731223053-c322873962e3
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/eapache/[email protected]20180814174437-776d5712da21/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/eapache/[email protected]20230731223053-c322873962e3/LICENSE:

The MIT License (MIT)

Expand Down Expand Up @@ -46261,11 +46235,13 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice

--------------------------------------------------------------------------------
Dependency : github.com/hashicorp/go-uuid
Version: v1.0.2
Version: v1.0.3
Licence type (autodetected): MPL-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/hashicorp/[email protected]/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/hashicorp/[email protected]/LICENSE:

Copyright © 2015-2022 HashiCorp, Inc.

Mozilla Public License, version 2.0

Expand Down Expand Up @@ -47700,11 +47676,11 @@ Contents of probable licence file $GOMODCACHE/github.com/jcmturner/dnsutils/v2@v

--------------------------------------------------------------------------------
Dependency : github.com/jcmturner/gofork
Version: v1.0.0
Version: v1.7.6
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gofork@v1.0.0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gofork@v1.7.6/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -52012,44 +51988,6 @@ Contents of probable licence file $GOMODCACHE/github.com/oxtoacart/[email protected]
limitations under the License.


--------------------------------------------------------------------------------
Dependency : github.com/pierrec/lz4
Version: v2.6.0+incompatible
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/pierrec/[email protected]+incompatible/LICENSE:

Copyright (c) 2015, Pierre Curto
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of xxHash nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



--------------------------------------------------------------------------------
Dependency : github.com/pkg/browser
Version: v0.0.0-20240102092130-5ac0b6a4141c
Expand Down
7 changes: 3 additions & 4 deletions filebeat/input/kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ import (
"fmt"
"time"

"github.com/Shopify/sarama"

"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
"github.com/elastic/beats/v7/libbeat/common/kafka"
"github.com/elastic/beats/v7/libbeat/common/transport/kerberos"
"github.com/elastic/beats/v7/libbeat/reader/parser"
"github.com/elastic/elastic-agent-libs/monitoring"
"github.com/elastic/elastic-agent-libs/monitoring/adapter"
"github.com/elastic/elastic-agent-libs/transport/tlscommon"
"github.com/elastic/sarama"
)

type kafkaInputConfig struct {
Expand Down Expand Up @@ -241,8 +240,8 @@ func (off *initialOffset) Unpack(value string) error {

func (st rebalanceStrategy) asSaramaStrategy() sarama.BalanceStrategy {
return map[rebalanceStrategy]sarama.BalanceStrategy{
rebalanceStrategyRange: sarama.BalanceStrategyRange,
rebalanceStrategyRoundRobin: sarama.BalanceStrategyRoundRobin,
rebalanceStrategyRange: sarama.NewBalanceStrategyRange(),
rebalanceStrategyRoundRobin: sarama.NewBalanceStrategyRoundRobin(),
}[st]
}

Expand Down
3 changes: 1 addition & 2 deletions filebeat/input/kafka/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import (
"github.com/elastic/beats/v7/libbeat/common/atomic"
"github.com/elastic/elastic-agent-libs/mapstr"

"github.com/Shopify/sarama"

input "github.com/elastic/beats/v7/filebeat/input/v2"
"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/common/acker"
Expand All @@ -42,6 +40,7 @@ import (
"github.com/elastic/beats/v7/libbeat/reader/parser"
conf "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/sarama"
)

const pluginName = "kafka"
Expand Down
12 changes: 8 additions & 4 deletions filebeat/input/kafka/kafka_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ import (
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/mapstr"

"github.com/Shopify/sarama"
"github.com/stretchr/testify/assert"

"github.com/elastic/sarama"

"github.com/elastic/beats/v7/libbeat/beat"
_ "github.com/elastic/beats/v7/libbeat/outputs/codec/format"
_ "github.com/elastic/beats/v7/libbeat/outputs/codec/json"
Expand Down Expand Up @@ -460,7 +461,8 @@ func findMessage(t *testing.T, text string, msgs []testMessage) *testMessage {
var msg *testMessage
for _, m := range msgs {
if text == m.message {
msg = &m
mCopy := m
msg = &mCopy
break
}
}
Expand Down Expand Up @@ -605,8 +607,10 @@ func run(t *testing.T, cfg *conf.C, client *beattest.ChanClient) (*kafkaInput, f
t.Cleanup(cancel)

pipeline := beattest.ConstClient(client)
input := inp.(*kafkaInput)
go input.Run(ctx, pipeline)
input, _ := inp.(*kafkaInput)
go func() {
_ = input.Run(ctx, pipeline)
}()
return input, cancel
}

Expand Down
Loading
Loading