MCPcopy Index your code
hub / github.com/cortexproject/cortex / newRulerClientFactory

Function newRulerClientFactory

pkg/ruler/client_pool.go:55–65  ·  view source on GitHub ↗
(clientCfg grpcclient.Config, reg prometheus.Registerer)

Source from the content-addressed store, hash-verified

53}
54
55func 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
67func dialRulerClient(clientCfg grpcclient.Config, addr string, requestDuration *prometheus.HistogramVec) (*rulerExtendedClient, error) {
68 opts, err := clientCfg.DialOption(grpcclient.Instrument(requestDuration))

Callers 2

newRulerClientPoolFunction · 0.85

Calls 1

dialRulerClientFunction · 0.85

Tested by 1