| 18 | ) |
| 19 | |
| 20 | func 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 | |
| 34 | func dialStoreGatewayClient(clientCfg grpcclient.ConfigWithHealthCheck, addr string, requestDuration *prometheus.HistogramVec) (*storeGatewayClient, error) { |
| 35 | opts, err := clientCfg.DialOption(grpcclient.Instrument(requestDuration)) |