| 53 | } |
| 54 | |
| 55 | func newRulerClientFactory(clientCfg grpcclient.Config, reg prometheus.Registerer) client.PoolFactory { |
| 56 | requestDuration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{ |
| 57 | Name: "cortex_ruler_client_request_duration_seconds", |
| 58 | Help: "Time spent executing requests to the ruler.", |
| 59 | Buckets: prometheus.ExponentialBuckets(0.008, 4, 7), |
| 60 | }, []string{"operation", "status_code"}) |
| 61 | |
| 62 | return func(addr string) (client.PoolClient, error) { |
| 63 | return dialRulerClient(clientCfg, addr, requestDuration) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func dialRulerClient(clientCfg grpcclient.Config, addr string, requestDuration *prometheus.HistogramVec) (*rulerExtendedClient, error) { |
| 68 | opts, err := clientCfg.DialOption(grpcclient.Instrument(requestDuration)) |