Skip to content

Commit

Permalink
Add warnings to series
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Jackson <jacksontj.89@gmail.com>
  • Loading branch information
jacksontj committed Jun 14, 2019
1 parent 1335ef4 commit 4eb94e3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/prometheus/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ type API interface {
// QueryRange performs a query for the given range.
QueryRange(ctx context.Context, query string, r Range) (model.Value, api.Warnings, error)
// Series finds series by label matchers.
Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, error)
Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, api.Warnings, error)
// Snapshot creates a snapshot of all current data into snapshots/<datetime>-<rand>
// under the TSDB's data directory and returns the directory as response.
Snapshot(ctx context.Context, skipHead bool) (SnapshotResult, error)
Expand Down Expand Up @@ -679,7 +679,7 @@ func (h *httpAPI) QueryRange(ctx context.Context, query string, r Range) (model.
return model.Value(qres.v), warnings, json.Unmarshal(body, &qres)
}

func (h *httpAPI) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, error) {
func (h *httpAPI) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, api.Warnings, error) {
u := h.client.URL(epSeries, nil)
q := u.Query()

Expand All @@ -697,13 +697,13 @@ func (h *httpAPI) Series(ctx context.Context, matches []string, startTime time.T
return nil, err
}

_, body, _, err := h.client.Do(ctx, req)
_, body, warnings, err := h.client.Do(ctx, req)
if err != nil {
return nil, err
return nil, warnings, err
}

var mset []model.LabelSet
return mset, json.Unmarshal(body, &mset)
return mset, warnings, json.Unmarshal(body, &mset)
}

func (h *httpAPI) Snapshot(ctx context.Context, skipHead bool) (SnapshotResult, error) {
Expand Down

0 comments on commit 4eb94e3

Please sign in to comment.