Skip to content

Commit 6bd05c9

Browse files
[release-2.6.x] Backport dskit, memberlist version updates to 2.6.x to support memberlist cluster labels and verification; re-vendor (#6693)
* Backport dskit, memberlist version updates to k105 to support memberlist cluster labels and verification; re-vendor (#6658) * Backport dskit, memberlist version updates to k105 to support memberlist cluster labels and verification; re-vendor Signed-off-by: JordanRushing <[email protected]> * Quick ingester client fix using new weaveworks/middleware package Signed-off-by: JordanRushing <[email protected]> * Update memberlist.libsonnet to include new cluster_label and cluster_label_verification configs Signed-off-by: JordanRushing <[email protected]> * Lint jsonnet Signed-off-by: JordanRushing <[email protected]> * manually resolved go.mod conflict * removed redundant mixin changes Co-authored-by: JordanRushing <[email protected]>
1 parent a835c38 commit 6bd05c9

Some content is hidden

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

46 files changed

+1500
-941
lines changed

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ require (
4949
github.com/google/uuid v1.2.0
5050
github.com/gorilla/mux v1.8.0
5151
github.com/gorilla/websocket v1.4.2
52-
github.com/grafana/dskit v0.0.0-20220331160727-49faf69f72ca
52+
github.com/grafana/dskit v0.0.0-20220708141012-99f3d0043c23
5353
github.com/grafana/go-gelf/v2 v2.0.1
5454
github.com/grafana/regexp v0.0.0-20220304100321-149c8afcd6cb
5555
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
@@ -92,7 +92,7 @@ require (
9292
github.com/thanos-io/thanos v0.22.0
9393
github.com/tonistiigi/fifo v0.0.0-20190226154929-a9fb20d87448
9494
github.com/uber/jaeger-client-go v2.30.0+incompatible
95-
github.com/weaveworks/common v0.0.0-20211015155308-ebe5bdc2c89e
95+
github.com/weaveworks/common v0.0.0-20220629114710-e3b70df0f08b
9696
github.com/xdg-go/scram v1.0.2
9797
go.etcd.io/bbolt v1.3.6
9898
go.uber.org/atomic v1.9.0
@@ -232,7 +232,7 @@ require (
232232
github.com/pmezard/go-difflib v1.0.0 // indirect
233233
github.com/prometheus/alertmanager v0.23.1-0.20210914172521-e35efbddb66a // indirect
234234
github.com/prometheus/common/sigv4 v0.1.0 // indirect
235-
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 // indirect
235+
github.com/prometheus/exporter-toolkit v0.7.1 // indirect
236236
github.com/prometheus/procfs v0.7.3 // indirect
237237
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
238238
github.com/rs/xid v1.2.1 // indirect
@@ -326,4 +326,4 @@ exclude k8s.io/client-go v8.0.0+incompatible
326326

327327
// Replace memberlist with our fork which includes some fixes that haven't been
328328
// merged upstream yet.
329-
replace github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20220425183535-6b97a09b7167
329+
replace github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20220708130638-bd88e10a3d91

go.sum

+6-7
Original file line numberDiff line numberDiff line change
@@ -1039,14 +1039,14 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U
10391039
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
10401040
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
10411041
github.com/grafana/dskit v0.0.0-20211021180445-3bd016e9d7f1/go.mod h1:uPG2nyK4CtgNDmWv7qyzYcdI+S90kHHRWvHnBtEMBXM=
1042-
github.com/grafana/dskit v0.0.0-20220331160727-49faf69f72ca h1:0qHzm6VS0bCsSWKHuyfpt+pdpyScdZbzY/IFIyKSYOk=
1043-
github.com/grafana/dskit v0.0.0-20220331160727-49faf69f72ca/go.mod h1:q51XdMLLHNZJSG6KOGujC20ed2OoLFdx0hBmOEVfRs0=
1042+
github.com/grafana/dskit v0.0.0-20220708141012-99f3d0043c23 h1:VF+BC/NBcxMP33P04x9j+4cSa1aBKafoS5RSVYtT4ic=
1043+
github.com/grafana/dskit v0.0.0-20220708141012-99f3d0043c23/go.mod h1:D5GdDQDsPN12+eGhq+lSCY4o/glBYO6NC8CRkzb23gs=
10441044
github.com/grafana/go-gelf/v2 v2.0.1 h1:BOChP0h/jLeD+7F9mL7tq10xVkDG15he3T1zHuQaWak=
10451045
github.com/grafana/go-gelf/v2 v2.0.1/go.mod h1:lexHie0xzYGwCgiRGcvZ723bSNyNI8ZRD4s0CLobh90=
10461046
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85 h1:xLuzPoOzdfNb/RF/IENCw+oLVdZB4G21VPhkHBgwSHY=
10471047
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85/go.mod h1:crI9WX6p0IhrqB+DqIUHulRW853PaNFf7o4UprV//3I=
1048-
github.com/grafana/memberlist v0.3.1-0.20220425183535-6b97a09b7167 h1:PgEQkGHR4YimSCEGT5IoswN9gJKZDVskf+he6UClCLw=
1049-
github.com/grafana/memberlist v0.3.1-0.20220425183535-6b97a09b7167/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
1048+
github.com/grafana/memberlist v0.3.1-0.20220708130638-bd88e10a3d91 h1:/NipyHnOmvRsVzj81j2qE0VxsvsqhOB0f4vJIhk2qCQ=
1049+
github.com/grafana/memberlist v0.3.1-0.20220708130638-bd88e10a3d91/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
10501050
github.com/grafana/regexp v0.0.0-20220202152315-e74e38789280/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
10511051
github.com/grafana/regexp v0.0.0-20220304100321-149c8afcd6cb h1:wwzNkyaQwcXCzQuKoWz3lwngetmcyg+EhW0fF5lz73M=
10521052
github.com/grafana/regexp v0.0.0-20220304100321-149c8afcd6cb/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
@@ -1673,7 +1673,6 @@ github.com/prometheus/exporter-toolkit v0.6.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQY
16731673
github.com/prometheus/exporter-toolkit v0.7.0/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
16741674
github.com/prometheus/exporter-toolkit v0.7.1 h1:c6RXaK8xBVercEeUQ4tRNL8UGWzDHfvj9dseo1FcK1Y=
16751675
github.com/prometheus/exporter-toolkit v0.7.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
1676-
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 h1:dTUS1vaLWq+Y6XKOTnrFpoVsQKLCbCp1OLj24TDi7oM=
16771676
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289/go.mod h1:FGbBv5OPKjch+jNUJmEQpMZytIdyW0NdBtWFcfSKusc=
16781677
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
16791678
github.com/prometheus/procfs v0.0.0-20180408092902-8b1c2da0d56d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
@@ -1888,8 +1887,8 @@ github.com/vmware/govmomi v0.18.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59b
18881887
github.com/vmware/govmomi v0.19.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
18891888
github.com/wavefronthq/wavefront-sdk-go v0.9.2/go.mod h1:hQI6y8M9OtTCtc0xdwh+dCER4osxXdEAeCpacjpDZEU=
18901889
github.com/weaveworks/common v0.0.0-20210913144402-035033b78a78/go.mod h1:YU9FvnS7kUnRt6HY10G+2qHkwzP3n3Vb1XsXDsJTSp8=
1891-
github.com/weaveworks/common v0.0.0-20211015155308-ebe5bdc2c89e h1:B0gVGyVpjfWJWSRe027EkhmEype0a0Dt2uHVxcPrhfs=
1892-
github.com/weaveworks/common v0.0.0-20211015155308-ebe5bdc2c89e/go.mod h1:GWX2dQ7yjrgvqH0+d3kCJC5bsY8oOFwqjxFMHaRK4/k=
1890+
github.com/weaveworks/common v0.0.0-20220629114710-e3b70df0f08b h1:SJ5hUUQFMfIQ55XT06vnCUqwpxz3HddMkLsYl/nGOvU=
1891+
github.com/weaveworks/common v0.0.0-20220629114710-e3b70df0f08b/go.mod h1:YfOOLoW1Q/jIIu0WLeSwgStmrKjuJEZSKTAUc+0KFvE=
18931892
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
18941893
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
18951894
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=

pkg/ingester/client/client.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"time"
77

88
"github.com/grafana/dskit/grpcclient"
9-
dsmiddleware "github.com/grafana/dskit/middleware"
109
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
1110
"github.com/opentracing/opentracing-go"
1211
"github.com/prometheus/client_golang/prometheus"
@@ -88,14 +87,14 @@ func instrumentation(cfg *Config) ([]grpc.UnaryClientInterceptor, []grpc.StreamC
8887
unaryInterceptors = append(unaryInterceptors,
8988
otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer()),
9089
middleware.ClientUserHeaderInterceptor,
91-
dsmiddleware.PrometheusGRPCUnaryInstrumentation(ingesterClientRequestDuration),
90+
middleware.UnaryClientInstrumentInterceptor(ingesterClientRequestDuration),
9291
)
9392
var streamInterceptors []grpc.StreamClientInterceptor
9493
streamInterceptors = append(streamInterceptors, cfg.GRCPStreamClientInterceptors...)
9594
streamInterceptors = append(streamInterceptors,
9695
otgrpc.OpenTracingStreamClientInterceptor(opentracing.GlobalTracer()),
9796
middleware.StreamClientUserHeaderInterceptor,
98-
dsmiddleware.PrometheusGRPCStreamInstrumentation(ingesterClientRequestDuration),
97+
middleware.StreamClientInstrumentInterceptor(ingesterClientRequestDuration),
9998
)
10099

101100
return unaryInterceptors, streamInterceptors

pkg/querier/worker/scheduler_processor.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/go-kit/log/level"
1212
"github.com/grafana/dskit/backoff"
1313
"github.com/grafana/dskit/grpcclient"
14-
dskit_middleware "github.com/grafana/dskit/middleware"
1514
"github.com/grafana/dskit/ring/client"
1615
"github.com/grafana/dskit/services"
1716
otgrpc "github.com/opentracing-contrib/go-grpc"
@@ -188,7 +187,7 @@ func (sp *schedulerProcessor) createFrontendClient(addr string) (client.PoolClie
188187
opts, err := sp.grpcConfig.DialOption([]grpc.UnaryClientInterceptor{
189188
otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer()),
190189
middleware.ClientUserHeaderInterceptor,
191-
dskit_middleware.PrometheusGRPCUnaryInstrumentation(sp.metrics.frontendClientRequestDuration),
190+
middleware.UnaryClientInstrumentInterceptor(sp.metrics.frontendClientRequestDuration),
192191
}, nil)
193192
if err != nil {
194193
return nil, err

pkg/storage/chunk/client/gcp/instrumentation.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import (
55
"strconv"
66
"time"
77

8-
"github.com/grafana/dskit/middleware"
98
otgrpc "github.com/opentracing-contrib/go-grpc"
109
opentracing "github.com/opentracing/opentracing-go"
1110
"github.com/prometheus/client_golang/prometheus"
1211
"github.com/prometheus/client_golang/prometheus/promauto"
12+
"github.com/weaveworks/common/middleware"
1313
"google.golang.org/api/option"
1414
"google.golang.org/grpc"
1515
)
@@ -39,11 +39,11 @@ var (
3939
func bigtableInstrumentation() ([]grpc.UnaryClientInterceptor, []grpc.StreamClientInterceptor) {
4040
return []grpc.UnaryClientInterceptor{
4141
otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer()),
42-
middleware.PrometheusGRPCUnaryInstrumentation(bigtableRequestDuration),
42+
middleware.UnaryClientInstrumentInterceptor(bigtableRequestDuration),
4343
},
4444
[]grpc.StreamClientInterceptor{
4545
otgrpc.OpenTracingStreamClientInterceptor(opentracing.GlobalTracer()),
46-
middleware.PrometheusGRPCStreamInstrumentation(bigtableRequestDuration),
46+
middleware.StreamClientInstrumentInterceptor(bigtableRequestDuration),
4747
}
4848
}
4949

production/ksonnet/loki/memberlist.libsonnet

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
'memberlist.abort-if-join-fails': false,
44
'memberlist.bind-port': gossipRingPort,
55
'memberlist.join': 'gossip-ring.%s.svc.cluster.local:%d' % [$._config.namespace, gossipRingPort],
6-
},
6+
} + (
7+
if $._config.memberlist_cluster_label == '' then {} else {
8+
'memberlist.cluster-label': $._config.memberlist_cluster_label,
9+
}
10+
) + (
11+
if !$._config.memberlist_cluster_label_verification_disabled then {} else {
12+
'memberlist.cluster-label-verification-disabled': true,
13+
}
14+
),
715

816
local setupGossipRing(storeOption, consulHostnameOption, multiStoreOptionsPrefix) = if $._config.multikv_migration_enabled then {
917
[storeOption]: 'multi',
@@ -21,6 +29,11 @@
2129
// but "primary" KV depends on value of multikv_primary.
2230
memberlist_ring_enabled: false,
2331

32+
// Configures the memberlist cluster label. When verification is enabled, a memberlist member rejects any packet or stream
33+
// with a mismatching cluster label.
34+
memberlist_cluster_label: '',
35+
memberlist_cluster_label_verification_disabled: false,
36+
2437
// Migrating from consul to memberlist is a multi-step process:
2538
// 1) Enable multikv_migration_enabled, with primary=consul, secondary=memberlist, and multikv_mirror_enabled=false, restart components.
2639
// 2) Set multikv_mirror_enabled=true. This doesn't require restart.

vendor/github.com/grafana/dskit/grpcclient/instrumentation.go

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/grafana/dskit/kv/consul/client.go

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)