diff --git a/go.mod b/go.mod index f4019bd3a7..87554f58f9 100644 --- a/go.mod +++ b/go.mod @@ -74,7 +74,6 @@ replace ( // Using a 3rd-party branch for custom dialer - see https://github.com/bradfitz/gomemcache/pull/86. // Required by Cortex https://github.com/cortexproject/cortex/pull/3051. github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab - //github.com/cortexproject/cortex => github.com/yeya24/cortex v0.2.0-rc.0.0.20200928222317-4caeb2cae5ab // Update to v1.1.1 to make sure windows CI pass. github.com/elastic/go-sysinfo => github.com/elastic/go-sysinfo v1.1.1 // Make sure Prometheus version is pinned as Prometheus semver does not include Go APIs. diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index fe5244a065..06576a9ec5 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -460,7 +460,7 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr return nil, nil, &api.ApiError{Typ: api.ErrorInternal, Err: errors.Wrap(err, "parse form")} } - if len(r.Form["match[]"]) == 0 { + if len(r.Form[MatcherParam]) == 0 { return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: errors.New("no match[] parameter provided")} } @@ -470,7 +470,7 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr } var matcherSets [][]*labels.Matcher - for _, s := range r.Form["match[]"] { + for _, s := range r.Form[MatcherParam] { matchers, err := parser.ParseMetricSelector(s) if err != nil { return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} diff --git a/pkg/queryfrontend/roundtrip.go b/pkg/queryfrontend/roundtrip.go index 10f9cc5133..4f1f4be02e 100644 --- a/pkg/queryfrontend/roundtrip.go +++ b/pkg/queryfrontend/roundtrip.go @@ -44,24 +44,14 @@ func NewTripperware( queryRangeCodec := NewThanosQueryRangeCodec(config.PartialResponseStrategy) metadataCodec := NewThanosMetadataCodec(config.PartialResponseStrategy) - //if config.SplitQueriesByInterval != 0 { - // // TODO(yeya24): make interval dynamic in next pr. - // queryIntervalFn := func(_ queryrange.Request) time.Duration { - // return config.SplitQueriesByInterval - // } - // splitIntervalMiddleware = queryrange.SplitByIntervalMiddleware(queryIntervalFn, limits, codec, reg) - //} - // - //if config.MaxRetries > 0 { - // retryMiddleware = queryrange.NewRetryMiddleware(logger, config.MaxRetries, queryrange.NewRetryMiddlewareMetrics(reg)) - //} - - queryRangeTripperware, err := newQueryRangeTripperware(config, limits, queryRangeCodec, prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "query_range"}, reg), logger) + queryRangeTripperware, err := newQueryRangeTripperware(config, limits, queryRangeCodec, + prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "query_range"}, reg), logger) if err != nil { return nil, err } - metadataTripperware, err := newMetadataTripperware(config, limits, metadataCodec, prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "metadata"}, reg), logger) + metadataTripperware, err := newMetadataTripperware(config, limits, metadataCodec, + prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "metadata"}, reg), logger) if err != nil { return nil, err } @@ -206,7 +196,6 @@ func newMetadataTripperware( reg prometheus.Registerer, logger log.Logger, ) (frontend.Tripperware, error) { - // metadata query don't have the limits middleware. metadataMiddleware := []queryrange.Middleware{queryrange.LimitsMiddleware(limits)} instrumentMetrics := queryrange.NewInstrumentMiddlewareMetrics(reg)