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

Method LabelValuesRaw

integration/e2ecortex/client.go:543–563  ·  view source on GitHub ↗

LabelValuesRaw runs a label values request directly against the querier API.

(label string, matches []string, startTime, endTime time.Time, headers map[string]string)

Source from the content-addressed store, hash-verified

541
542// LabelValuesRaw runs a label values request directly against the querier API.
543func (c *Client) LabelValuesRaw(label string, matches []string, startTime, endTime time.Time, headers map[string]string) (*http.Response, []byte, error) {
544 u := &url.URL{
545 Scheme: "http",
546 Path: fmt.Sprintf("%s/api/prom/api/v1/label/%s/values", c.querierAddress, label),
547 }
548 q := u.Query()
549
550 for _, m := range matches {
551 q.Add("match[]", m)
552 }
553
554 if !startTime.IsZero() {
555 q.Set("start", FormatTime(startTime))
556 }
557 if !endTime.IsZero() {
558 q.Set("end", FormatTime(endTime))
559 }
560
561 u.RawQuery = q.Encode()
562 return c.query(u.String(), headers)
563}
564
565// RemoteRead runs a remote read query.
566func (c *Client) RemoteRead(matchers []*labels.Matcher, start, end time.Time, step time.Duration) (*prompb.ReadResponse, error) {

Calls 7

queryMethod · 0.95
FormatTimeFunction · 0.85
QueryMethod · 0.65
SetMethod · 0.65
EncodeMethod · 0.65
StringMethod · 0.65
AddMethod · 0.45