MCPcopy Create free account
hub / github.com/cortexproject/cortex / dialStoreGatewayClient

Function dialStoreGatewayClient

pkg/querier/store_gateway_client.go:34–50  ·  view source on GitHub ↗
(clientCfg grpcclient.ConfigWithHealthCheck, addr string, requestDuration *prometheus.HistogramVec)

Source from the content-addressed store, hash-verified

32}
33
34func dialStoreGatewayClient(clientCfg grpcclient.ConfigWithHealthCheck, addr string, requestDuration *prometheus.HistogramVec) (*storeGatewayClient, error) {
35 opts, err := clientCfg.DialOption(grpcclient.Instrument(requestDuration))
36 if err != nil {
37 return nil, err
38 }
39
40 conn, err := grpc.NewClient(addr, opts...)
41 if err != nil {
42 return nil, errors.Wrapf(err, "failed to dial store-gateway %s", addr)
43 }
44
45 return &storeGatewayClient{
46 StoreGatewayClient: storegatewaypb.NewStoreGatewayClient(conn),
47 HealthClient: grpc_health_v1.NewHealthClient(conn),
48 conn: conn,
49 }, nil
50}
51
52type storeGatewayClient struct {
53 storegatewaypb.StoreGatewayClient

Callers 1

Calls 3

InstrumentFunction · 0.92
NewStoreGatewayClientFunction · 0.92
DialOptionMethod · 0.45

Tested by

no test coverage detected