Skip to content

Commit 281dcad

Browse files
committed
receive: Allow specifying a custom gRPC service config via flag
Signed-off-by: Philip Gough <[email protected]>
1 parent dc4c49f commit 281dcad

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
4040
- [#7855](https://github.com/thanos-io/thanos/pull/7855) Compcat/Query: Add support for comma separated replica labels.
4141
- [#7654](https://github.com/thanos-io/thanos/pull/7654) *: Add '--grpc-server-tls-min-version' flag to allow user to specify TLS version, otherwise default to TLS 1.3
4242
- [#7854](https://github.com/thanos-io/thanos/pull/7854) Query Frontend: Add `--query-frontend.force-query-stats` flag to force collection of query statistics from upstream queriers.
43+
- [#7907](https://github.com/thanos-io/thanos/pull/7907) Receive: Add `--receive.grpc-service-config` flag to configure gRPC service config for the receivers.
4344

4445
### Changed
4546

cmd/thanos/receive.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ func runReceive(
172172
dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.UseCompressor(conf.compression)))
173173
}
174174

175+
if conf.grpcServiceConfig != "" {
176+
dialOpts = append(dialOpts, grpc.WithDefaultServiceConfig(conf.grpcServiceConfig))
177+
}
178+
175179
var bkt objstore.Bucket
176180
confContentYaml, err := conf.objStoreConfig.Content()
177181
if err != nil {
@@ -853,6 +857,7 @@ type receiveConfig struct {
853857
maxBackoff *model.Duration
854858
compression string
855859
replicationProtocol string
860+
grpcServiceConfig string
856861

857862
tsdbMinBlockDuration *model.Duration
858863
tsdbMaxBlockDuration *model.Duration
@@ -964,6 +969,8 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) {
964969

965970
cmd.Flag("receive.capnproto-address", "Address for the Cap'n Proto server.").Default(fmt.Sprintf("0.0.0.0:%s", receive.DefaultCapNProtoPort)).StringVar(&rc.replicationAddr)
966971

972+
cmd.Flag("receive.grpc-service-config", "gRPC service configuration file or content in JSON format. See https://github.com/grpc/grpc/blob/master/doc/service_config.md").PlaceHolder("<content>").Default("").StringVar(&rc.grpcServiceConfig)
973+
967974
rc.forwardTimeout = extkingpin.ModelDuration(cmd.Flag("receive-forward-timeout", "Timeout for each forward request.").Default("5s").Hidden())
968975

969976
rc.maxBackoff = extkingpin.ModelDuration(cmd.Flag("receive-forward-max-backoff", "Maximum backoff for each forward fan-out request").Default("5s").Hidden())

docs/components/receive.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ Flags:
428428
Compression algorithm to use for gRPC requests
429429
to other receivers. Must be one of: snappy,
430430
none
431+
--receive.grpc-service-config=<content>
432+
gRPC service configuration file
433+
or content in JSON format. See
434+
https://github.com/grpc/grpc/blob/master/doc/service_config.md
431435
--receive.hashrings=<content>
432436
Alternative to 'receive.hashrings-file' flag
433437
(lower priority). Content of file that contains

0 commit comments

Comments
 (0)