Skip to content

Commit

Permalink
cleanup go mod
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Oct 5, 2020
1 parent 3e84336 commit 4920918
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/query/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
}

Expand All @@ -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}
Expand Down
19 changes: 4 additions & 15 deletions pkg/queryfrontend/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 4920918

Please sign in to comment.