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

chore(build): switch and bump new version for IBM/sarama #5180

Merged
merged 6 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Main (unreleased)
have been standardized. The first fields will always be `ts`, `level`, and
`msg`, followed by non-common fields. Previously, the position of `msg` was
not consistent. (@rfratto)
- Switch to `IBM/sarama` module. (@hainenber)

### Bugfixes

Expand Down
2 changes: 1 addition & 1 deletion component/loki/source/azure_event_hubs/azure_event_hubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net"
"sync"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log/level"
"github.com/grafana/agent/component"
"github.com/grafana/agent/component/common/loki"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/grafana/agent/component/common/loki"
"github.com/grafana/loki/pkg/logproto"
"github.com/prometheus/common/model"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/relabel"
"github.com/stretchr/testify/assert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/xdg-go/scram"
)

// copied from https://github.com/Shopify/sarama/blob/44627b731c60bb90efe25573e7ef2b3f8df3fa23/examples/sasl_scram_client/scram_client.go
// copied from https://github.com/IBM/sarama/blob/44627b731c60bb90efe25573e7ef2b3f8df3fa23/examples/sasl_scram_client/scram_client.go
var (
SHA256 scram.HashGeneratorFcn = sha256.New
SHA512 scram.HashGeneratorFcn = sha512.New
Expand Down
2 changes: 1 addition & 1 deletion component/loki/source/internal/kafkatarget/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kafkatarget

import (
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/grafana/agent/component/common/loki"
"github.com/grafana/dskit/flagext"
promconfig "github.com/prometheus/common/config"
Expand Down
2 changes: 1 addition & 1 deletion component/loki/source/internal/kafkatarget/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/backoff"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log"
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion component/loki/source/internal/kafkatarget/kafkatarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/agent/component/common/loki"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/grafana/agent/component/common/loki/client/fake"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/relabel"
"github.com/stretchr/testify/require"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
)

func NewOAuthProvider(opts OAuthConfig) (sarama.AccessTokenProvider, error) {
Expand Down
2 changes: 1 addition & 1 deletion component/loki/source/internal/kafkatarget/parser.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kafkatarget

import (
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/grafana/agent/component/common/loki"
"github.com/grafana/loki/pkg/logproto"
"github.com/prometheus/common/model"
Expand Down
8 changes: 4 additions & 4 deletions component/loki/source/internal/kafkatarget/target_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
promconfig "github.com/prometheus/common/config"
Expand Down Expand Up @@ -65,11 +65,11 @@ func NewSyncer(

switch cfg.KafkaConfig.Assignor {
case sarama.StickyBalanceStrategyName:
config.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategySticky
config.Consumer.Group.Rebalance.Strategy = sarama.NewBalanceStrategySticky()
case sarama.RoundRobinBalanceStrategyName:
config.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategyRoundRobin
config.Consumer.Group.Rebalance.Strategy = sarama.NewBalanceStrategyRoundRobin()
case sarama.RangeBalanceStrategyName, "":
config.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategyRange
config.Consumer.Group.Rebalance.Strategy = sarama.NewBalanceStrategyRange()
default:
return nil, fmt.Errorf("unrecognized consumer group partition assignor: %s", cfg.KafkaConfig.Assignor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/grafana/dskit/flagext"
"github.com/prometheus/common/config"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/relabel"
Expand Down
2 changes: 1 addition & 1 deletion component/loki/source/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"sync"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/go-kit/log/level"
"github.com/grafana/agent/component"
"github.com/grafana/agent/component/common/config"
Expand Down
2 changes: 1 addition & 1 deletion component/prometheus/exporter/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kafka
import (
"fmt"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/grafana/agent/component"
"github.com/grafana/agent/component/discovery"
"github.com/grafana/agent/component/prometheus/exporter"
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0
github.com/Azure/go-autorest/autorest v0.11.29
github.com/IBM/sarama v1.40.1
github.com/Lusitaniae/apache_exporter v0.11.1-0.20220518131644-f9522724dab4
github.com/Masterminds/sprig/v3 v3.2.3
github.com/PuerkitoBio/rehttp v1.1.0
github.com/Shopify/sarama v1.38.1
github.com/alecthomas/kingpin/v2 v2.3.2
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
github.com/aws/aws-sdk-go v1.44.327
Expand Down Expand Up @@ -625,6 +625,7 @@ require (
)

require (
github.com/Shopify/sarama v1.38.1 // indirect
github.com/Workiva/go-datastructures v1.1.0 // indirect
github.com/drone/envsubst v1.0.3 // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 h1:KeNholpO2xKjgaa
github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962/go.mod h1:kC29dT1vFpj7py2OvG1khBdQpo3kInWP+6QipLbdngo=
github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM=
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
github.com/IBM/sarama v1.40.1 h1:lL01NNg/iBeigUbT+wpPysuTYW6roHo6kc1QrffRf0k=
github.com/IBM/sarama v1.40.1/go.mod h1:+5OFwA5Du9I6QrznhaMHsuwWdWZNMjaBSIxEWEgKOYE=
github.com/Jeffail/gabs v1.1.0/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/integrations/kafka_exporter/kafka_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

config_util "github.com/prometheus/common/config"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
kafka_exporter "github.com/davidmparrott/kafka_exporter/v2/exporter"
"github.com/go-kit/log"
"github.com/grafana/agent/pkg/integrations"
Expand Down