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

Method LabelNamesRaw

integration/e2ecortex/client.go:520–540  ·  view source on GitHub ↗

LabelNamesRaw runs a label names request directly against the querier API.

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

Source from the content-addressed store, hash-verified

518
519// LabelNamesRaw runs a label names request directly against the querier API.
520func (c *Client) LabelNamesRaw(matches []string, startTime, endTime time.Time, headers map[string]string) (*http.Response, []byte, error) {
521 u := &url.URL{
522 Scheme: "http",
523 Path: fmt.Sprintf("%s/api/prom/api/v1/labels", c.querierAddress),
524 }
525 q := u.Query()
526
527 for _, m := range matches {
528 q.Add("match[]", m)
529 }
530
531 if !startTime.IsZero() {
532 q.Set("start", FormatTime(startTime))
533 }
534 if !endTime.IsZero() {
535 q.Set("end", FormatTime(endTime))
536 }
537
538 u.RawQuery = q.Encode()
539 return c.query(u.String(), headers)
540}
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) {

Calls 7

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