()
| 242 | } |
| 243 | |
| 244 | func (t *Cortex) initDistributorService() (serv services.Service, err error) { |
| 245 | t.Cfg.Distributor.DistributorRing.ListenPort = t.Cfg.Server.GRPCListenPort |
| 246 | t.Cfg.Distributor.ShuffleShardingLookbackPeriod = t.Cfg.Querier.ShuffleShardingIngestersLookbackPeriod |
| 247 | t.Cfg.Distributor.NameValidationScheme = t.Cfg.NameValidationScheme |
| 248 | t.Cfg.IngesterClient.GRPCClientConfig.SignWriteRequestsEnabled = t.Cfg.Distributor.SignWriteRequestsEnabled |
| 249 | // The client signs with the first key in the list; additional keys are only used on the |
| 250 | // server side (ingester) for accepting signatures during key rotation. |
| 251 | if keys := t.Cfg.Distributor.SignWriteRequestsKeys.Value(); len(keys) > 0 { |
| 252 | t.Cfg.IngesterClient.GRPCClientConfig.SignWriteRequestsKey = keys[0] |
| 253 | } |
| 254 | |
| 255 | // Check whether the distributor can join the distributors ring, which is |
| 256 | // whenever it's not running as an internal dependency (ie. querier or |
| 257 | // ruler's dependency) |
| 258 | canJoinDistributorsRing := t.Cfg.isModuleEnabled(Distributor) || t.Cfg.isModuleEnabled(All) |
| 259 | |
| 260 | t.Distributor, err = distributor.New(t.Cfg.Distributor, t.Cfg.IngesterClient, t.OverridesConfig, t.Ring, canJoinDistributorsRing, prometheus.DefaultRegisterer, util_log.Logger) |
| 261 | if err != nil { |
| 262 | return |
| 263 | } |
| 264 | |
| 265 | return t.Distributor, nil |
| 266 | } |
| 267 | |
| 268 | func (t *Cortex) initGrpcClientServices() (serv services.Service, err error) { |
| 269 | s := grpcclient.NewHealthCheckInterceptors(util_log.Logger) |
nothing calls this directly
no test coverage detected