LabelNamesRaw runs a label names request directly against the querier API.
(matches []string, startTime, endTime time.Time, headers map[string]string)
| 518 | |
| 519 | // LabelNamesRaw runs a label names request directly against the querier API. |
| 520 | func (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. |
| 543 | func (c *Client) LabelValuesRaw(label string, matches []string, startTime, endTime time.Time, headers map[string]string) (*http.Response, []byte, error) { |