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

Function newStoreGatewayClientFactory

pkg/querier/store_gateway_client.go:20–32  ·  view source on GitHub ↗
(clientCfg grpcclient.ConfigWithHealthCheck, reg prometheus.Registerer)

Source from the content-addressed store, hash-verified

18)
19
20func newStoreGatewayClientFactory(clientCfg grpcclient.ConfigWithHealthCheck, reg prometheus.Registerer) client.PoolFactory {
21 requestDuration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
22 Namespace: "cortex",
23 Name: "storegateway_client_request_duration_seconds",
24 Help: "Time spent executing requests to the store-gateway.",
25 Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
26 ConstLabels: prometheus.Labels{"client": "querier"},
27 }, []string{"operation", "status_code"})
28
29 return func(addr string) (client.PoolClient, error) {
30 return dialStoreGatewayClient(clientCfg, addr, requestDuration)
31 }
32}
33
34func dialStoreGatewayClient(clientCfg grpcclient.ConfigWithHealthCheck, addr string, requestDuration *prometheus.HistogramVec) (*storeGatewayClient, error) {
35 opts, err := clientCfg.DialOption(grpcclient.Instrument(requestDuration))

Callers 2

Calls 1

dialStoreGatewayClientFunction · 0.85

Tested by 1