QueryRaw runs a query directly against the querier API.
(query string, ts time.Time, headers map[string]string)
| 479 | |
| 480 | // QueryRaw runs a query directly against the querier API. |
| 481 | func (c *Client) QueryRaw(query string, ts time.Time, headers map[string]string) (*http.Response, []byte, error) { |
| 482 | u := &url.URL{ |
| 483 | Scheme: "http", |
| 484 | Path: fmt.Sprintf("%s/api/prom/api/v1/query", c.querierAddress), |
| 485 | } |
| 486 | q := u.Query() |
| 487 | q.Set("query", query) |
| 488 | |
| 489 | if !ts.IsZero() { |
| 490 | q.Set("time", FormatTime(ts)) |
| 491 | } |
| 492 | u.RawQuery = q.Encode() |
| 493 | return c.query(u.String(), headers) |
| 494 | } |
| 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) { |