Skip to content

Commit

Permalink
rebased
Browse files Browse the repository at this point in the history
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
  • Loading branch information
krasi-georgiev committed Aug 10, 2020
1 parent 85d2c18 commit 2c6d15d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 771 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#2895](https://github.com/thanos-io/thanos/pull/2895) Compact: Fix increment of `thanos_compact_downsample_total` metric for downsample of 5m resolution blocks.
- [#2858](https://github.com/thanos-io/thanos/pull/2858) Store: Fix `--store.grpc.series-sample-limit` implementation. The limit is now applied to the sum of all samples fetched across all queried blocks via a single Series call, instead of applying it individually to each block.
- [#2936](https://github.com/thanos-io/thanos/pull/2936) Compact: Fix ReplicaLabelRemover panic when replicaLabels are not specified.
- [#3010](https://github.com/thanos-io/thanos/pull/3010) Querier: Data gaps when switching iterators.
- [#2956](https://github.com/thanos-io/thanos/pull/2956) Store: Fix fetching of chunks bigger than 16000 bytes.
- [#2970](https://github.com/thanos-io/thanos/pull/2970) Store: Upgrade minio-go/v7 to fix slowness when running on EKS.
- [#2976](https://github.com/thanos-io/thanos/pull/2976) Query: Better rounding for incoming query timestamps.
Expand Down
17 changes: 16 additions & 1 deletion pkg/api/query/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,15 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr
return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}
}

var step time.Duration
if t := r.FormValue("step"); t != "" {
var err error
step, err = parseDuration(t)
if err != nil {
return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}
}
}

var matcherSets [][]*labels.Matcher
for _, s := range r.Form["match[]"] {
matchers, err := parser.ParseMetricSelector(s)
Expand Down Expand Up @@ -526,8 +535,14 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr
metrics = []labels.Labels{}
sets []storage.SeriesSet
)

hints := &storage.SelectHints{
Start: timestamp.FromTime(start),
End: timestamp.FromTime(end),
Step: int64(step),
}
for _, mset := range matcherSets {
sets = append(sets, q.Select(false, nil, mset...))
sets = append(sets, q.Select(false, hints, mset...))
}

set := storage.NewMergeSeriesSet(sets, storage.ChainedSeriesMerge)
Expand Down
Loading

0 comments on commit 2c6d15d

Please sign in to comment.