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

Method QueryRange

integration/e2ecortex/client.go:437–464  ·  view source on GitHub ↗

QueryRange runs a query range.

(query string, start, end time.Time, step time.Duration)

Source from the content-addressed store, hash-verified

435
436// QueryRange runs a query range.
437func (c *Client) QueryRange(query string, start, end time.Time, step time.Duration) (model.Value, error) {
438 ctx := context.Background()
439 retries := backoff.New(ctx, backoff.Config{
440 MinBackoff: 1 * time.Second,
441 MaxBackoff: 3 * time.Second,
442 MaxRetries: 5,
443 })
444 var (
445 value model.Value
446 err error
447 )
448 for retries.Ongoing() {
449 value, _, err = c.querierClient.QueryRange(context.Background(), query, promv1.Range{
450 Start: start,
451 End: end,
452 Step: step,
453 })
454 if err == nil {
455 break
456 }
457 if !strings.Contains(err.Error(), "EOF") {
458 break
459 }
460 retries.Wait()
461 }
462
463 return value, err
464}
465
466// QueryRangeRaw runs a ranged query directly against the querier API.
467func (c *Client) QueryRangeRaw(query string, start, end time.Time, step time.Duration, headers map[string]string) (*http.Response, []byte, error) {

Calls 4

NewFunction · 0.92
OngoingMethod · 0.80
ErrorMethod · 0.45
WaitMethod · 0.45