| 1189 | } |
| 1190 | |
| 1191 | func (h *httpAPI) Series(ctx context.Context, matches []string, startTime, endTime time.Time, opts ...Option) ([]model.LabelSet, Warnings, error) { |
| 1192 | u := h.client.URL(epSeries, nil) |
| 1193 | q := addOptionalURLParams(u.Query(), opts) |
| 1194 | |
| 1195 | for _, m := range matches { |
| 1196 | q.Add("match[]", m) |
| 1197 | } |
| 1198 | |
| 1199 | if !startTime.IsZero() { |
| 1200 | q.Set("start", formatTime(startTime)) |
| 1201 | } |
| 1202 | if !endTime.IsZero() { |
| 1203 | q.Set("end", formatTime(endTime)) |
| 1204 | } |
| 1205 | |
| 1206 | _, body, warnings, err := h.client.DoGetFallback(ctx, u, q) |
| 1207 | if err != nil { |
| 1208 | return nil, warnings, err |
| 1209 | } |
| 1210 | |
| 1211 | var mset []model.LabelSet |
| 1212 | return mset, warnings, json.Unmarshal(body, &mset) |
| 1213 | } |
| 1214 | |
| 1215 | func (h *httpAPI) Snapshot(ctx context.Context, skipHead bool) (SnapshotResult, error) { |
| 1216 | u := h.client.URL(epSnapshot, nil) |