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

Method doRequest

pkg/alertmanager/distributor.go:291–300  ·  view source on GitHub ↗
(ctx context.Context, am ring.InstanceDesc, req *httpgrpc.HTTPRequest)

Source from the content-addressed store, hash-verified

289}
290
291func (d *Distributor) doRequest(ctx context.Context, am ring.InstanceDesc, req *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error) {
292 ctx, cancel := context.WithTimeout(ctx, d.cfg.RemoteTimeout)
293 defer cancel()
294 amClient, err := d.alertmanagerClientsPool.GetClientFor(am.Addr)
295 if err != nil {
296 return nil, errors.Wrapf(err, "failed to get alertmanager client from pool (alertmanager address: %s)", am.Addr)
297 }
298
299 return amClient.HandleRequest(ctx, req)
300}
301
302func httpToHttpgrpcHeaders(hs http.Header) []*httpgrpc.Header {
303 result := make([]*httpgrpc.Header, 0, len(hs))

Callers 2

doQuorumMethod · 0.95
doUnaryMethod · 0.95

Calls 2

GetClientForMethod · 0.65
HandleRequestMethod · 0.65

Tested by

no test coverage detected