SeriesRaw runs a series request directly against the querier API.
(matches []string, startTime, endTime time.Time, headers map[string]string)
| 495 | |
| 496 | // SeriesRaw runs a series request directly against the querier API. |
| 497 | func (c *Client) SeriesRaw(matches []string, startTime, endTime time.Time, headers map[string]string) (*http.Response, []byte, error) { |
| 498 | u := &url.URL{ |
| 499 | Scheme: "http", |
| 500 | Path: fmt.Sprintf("%s/api/prom/api/v1/series", c.querierAddress), |
| 501 | } |
| 502 | q := u.Query() |
| 503 | |
| 504 | for _, m := range matches { |
| 505 | q.Add("match[]", m) |
| 506 | } |
| 507 | |
| 508 | if !startTime.IsZero() { |
| 509 | q.Set("start", FormatTime(startTime)) |
| 510 | } |
| 511 | if !endTime.IsZero() { |
| 512 | q.Set("end", FormatTime(endTime)) |
| 513 | } |
| 514 | |
| 515 | u.RawQuery = q.Encode() |
| 516 | return c.query(u.String(), headers) |
| 517 | } |
| 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) { |