Skip to content

Commit 6e12447

Browse files
aknuds1alvinlin123
authored andcommitted
Chore: Use dskit/grpc* (cortexproject#4523)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Signed-off-by: Alvin Lin <alvinlin@amazon.com>
1 parent 0bf901a commit 6e12447

File tree

756 files changed

+777
-124137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

756 files changed

+777
-124137
lines changed

docs/configuration/config-file-reference.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3809,6 +3809,16 @@ The `memberlist_config` configures the Gossip memberlist.
38093809
# CLI flag: -memberlist.compression-enabled
38103810
[compression_enabled: <boolean> | default = true]
38113811
3812+
# Gossip address to advertise to other members in the cluster. Used for NAT
3813+
# traversal.
3814+
# CLI flag: -memberlist.advertise-addr
3815+
[advertise_addr: <string> | default = ""]
3816+
3817+
# Gossip port to advertise to other members in the cluster. Used for NAT
3818+
# traversal.
3819+
# CLI flag: -memberlist.advertise-port
3820+
[advertise_port: <int> | default = 7946]
3821+
38123822
# Other cluster members to join. Can be specified multiple times. It can be an
38133823
# IP, hostname or an entry specified in the DNS Service Discovery format.
38143824
# CLI flag: -memberlist.join

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ require (
2929
github.com/golang/protobuf v1.5.2
3030
github.com/golang/snappy v0.0.4
3131
github.com/gorilla/mux v1.8.0
32-
github.com/grafana/dskit v0.0.0-20210908150159-fcf48cb19aa4
33-
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
32+
github.com/grafana/dskit v0.0.0-20211007183133-4c566019f311
3433
github.com/json-iterator/go v1.1.11
3534
github.com/lib/pq v1.3.0
3635
github.com/minio/minio-go/v7 v7.0.10
@@ -52,7 +51,7 @@ require (
5251
github.com/stretchr/testify v1.7.0
5352
github.com/thanos-io/thanos v0.22.0
5453
github.com/uber/jaeger-client-go v2.29.1+incompatible
55-
github.com/weaveworks/common v0.0.0-20210901124008-1fa3f9fa874c
54+
github.com/weaveworks/common v0.0.0-20210913144402-035033b78a78
5655
go.etcd.io/bbolt v1.3.6
5756
go.uber.org/atomic v1.9.0
5857
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f

go.sum

Lines changed: 6 additions & 36 deletions
Large diffs are not rendered by default.

pkg/alertmanager/alertmanager_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"time"
66

77
"github.com/go-kit/log"
8+
"github.com/grafana/dskit/crypto/tls"
9+
"github.com/grafana/dskit/grpcclient"
810
"github.com/pkg/errors"
911
"github.com/prometheus/client_golang/prometheus"
1012
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -13,8 +15,6 @@ import (
1315

1416
"github.com/cortexproject/cortex/pkg/alertmanager/alertmanagerpb"
1517
"github.com/cortexproject/cortex/pkg/ring/client"
16-
"github.com/cortexproject/cortex/pkg/util/grpcclient"
17-
"github.com/cortexproject/cortex/pkg/util/tls"
1818
)
1919

2020
// ClientsPool is the interface used to get the client from the pool for a specified address.

pkg/chunk/gcp/bigtable_index_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import (
1212

1313
"cloud.google.com/go/bigtable"
1414
"github.com/go-kit/log"
15+
"github.com/grafana/dskit/grpcclient"
1516
ot "github.com/opentracing/opentracing-go"
1617
"github.com/pkg/errors"
1718

1819
"github.com/cortexproject/cortex/pkg/chunk"
1920
chunk_util "github.com/cortexproject/cortex/pkg/chunk/util"
20-
"github.com/cortexproject/cortex/pkg/util/grpcclient"
2121
"github.com/cortexproject/cortex/pkg/util/math"
2222
"github.com/cortexproject/cortex/pkg/util/spanlogger"
2323
)

pkg/configs/client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"time"
1313

1414
"github.com/go-kit/log/level"
15+
dstls "github.com/grafana/dskit/crypto/tls"
1516
"github.com/grafana/dskit/flagext"
1617
"github.com/prometheus/client_golang/prometheus"
1718
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -20,7 +21,6 @@ import (
2021

2122
"github.com/cortexproject/cortex/pkg/configs/userconfig"
2223
util_log "github.com/cortexproject/cortex/pkg/util/log"
23-
tls_cfg "github.com/cortexproject/cortex/pkg/util/tls"
2424
)
2525

2626
var (
@@ -29,9 +29,9 @@ var (
2929

3030
// Config says where we can find the ruler userconfig.
3131
type Config struct {
32-
ConfigsAPIURL flagext.URLValue `yaml:"configs_api_url"`
33-
ClientTimeout time.Duration `yaml:"client_timeout"` // HTTP timeout duration for requests made to the Weave Cloud configs service.
34-
TLS tls_cfg.ClientConfig `yaml:",inline"`
32+
ConfigsAPIURL flagext.URLValue `yaml:"configs_api_url"`
33+
ClientTimeout time.Duration `yaml:"client_timeout"` // HTTP timeout duration for requests made to the Weave Cloud configs service.
34+
TLS dstls.ClientConfig `yaml:",inline"`
3535
}
3636

3737
// RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet

pkg/configs/db/dbtest/integration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build integration
12
// +build integration
23

34
package dbtest

pkg/configs/db/dbtest/unit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !integration
12
// +build !integration
23

34
package dbtest

pkg/configs/legacy_promql/fuzz.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313

1414
// Only build when go-fuzz is in use
15+
//go:build gofuzz
1516
// +build gofuzz
1617

1718
package promql

pkg/cortex/cortex.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/go-kit/log"
1414
"github.com/go-kit/log/level"
1515
"github.com/grafana/dskit/flagext"
16+
"github.com/grafana/dskit/grpcutil"
1617
"github.com/grafana/dskit/kv/memberlist"
1718
"github.com/grafana/dskit/modules"
1819
"github.com/grafana/dskit/runtimeconfig"
@@ -58,7 +59,6 @@ import (
5859
"github.com/cortexproject/cortex/pkg/tenant"
5960
"github.com/cortexproject/cortex/pkg/util"
6061
"github.com/cortexproject/cortex/pkg/util/fakeauth"
61-
"github.com/cortexproject/cortex/pkg/util/grpc/healthcheck"
6262
util_log "github.com/cortexproject/cortex/pkg/util/log"
6363
"github.com/cortexproject/cortex/pkg/util/process"
6464
"github.com/cortexproject/cortex/pkg/util/validation"
@@ -430,7 +430,7 @@ func (t *Cortex) Run() error {
430430
// before starting servers, register /ready handler and gRPC health check service.
431431
// It should reflect entire Cortex.
432432
t.Server.HTTP.Path("/ready").Handler(t.readyHandler(sm))
433-
grpc_health_v1.RegisterHealthServer(t.Server.GRPC, healthcheck.New(sm))
433+
grpc_health_v1.RegisterHealthServer(t.Server.GRPC, grpcutil.NewHealthCheck(sm))
434434

435435
// Let's listen for events from this manager, and log them.
436436
healthy := func() { level.Info(util_log.Logger).Log("msg", "Cortex started") }

0 commit comments

Comments
 (0)