From cedea118cb2ce38e652de623246ba61f531cde96 Mon Sep 17 00:00:00 2001 From: Bartlomiej Plotka Date: Sun, 26 Jan 2020 08:58:22 +0100 Subject: [PATCH] Revert "add flag max query samples (#1369)" (#2043) This reverts commit 912e1015621da831660d016ad693498337337ff8. --- cmd/thanos/query.go | 12 ++++-------- docs/components/query.md | 3 --- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index 4d71537770..9d3412db31 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -6,13 +6,12 @@ import ( "math" "net/http" "path" - "strconv" "time" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/oklog/run" - "github.com/opentracing/opentracing-go" + opentracing "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/route" @@ -68,8 +67,6 @@ func registerQuery(m map[string]setupFunc, app *kingpin.Application) { instantDefaultMaxSourceResolution := modelDuration(cmd.Flag("query.instant.default.max_source_resolution", "default value for max_source_resolution for instant queries. If not set, defaults to 0s only taking raw resolution into account. 1h can be a good value if you use instant queries over time ranges that incorporate times outside of your raw-retention.").Default("0s").Hidden()) - maxQuerySamples := cmd.Flag("query.max-samples", "Maximum number of samples a single query can load into memory.").Default(strconv.Itoa(math.MaxInt32)).Int() - selectorLabels := cmd.Flag("selector-label", "Query selector labels that will be exposed in info endpoint (repeated)."). PlaceHolder("=\"\"").Strings() @@ -161,7 +158,6 @@ func registerQuery(m map[string]setupFunc, app *kingpin.Application) { time.Duration(*unhealthyStoreTimeout), time.Duration(*instantDefaultMaxSourceResolution), component.Query, - *maxQuerySamples, ) } } @@ -202,7 +198,6 @@ func runQuery( unhealthyStoreTimeout time.Duration, instantDefaultMaxSourceResolution time.Duration, comp component.Component, - maxQuerySamples int, ) error { // TODO(bplotka in PR #513 review): Move arguments into struct. duplicatedStores := prometheus.NewCounter(prometheus.CounterOpts{ @@ -247,8 +242,9 @@ func runQuery( Logger: logger, Reg: reg, MaxConcurrent: maxConcurrentQueries, - MaxSamples: maxQuerySamples, - Timeout: queryTimeout, + // TODO(bwplotka): Expose this as a flag: https://github.com/thanos-io/thanos/issues/703. + MaxSamples: math.MaxInt32, + Timeout: queryTimeout, }, ) ) diff --git a/docs/components/query.md b/docs/components/query.md index 537f9e0f5b..81c0265f58 100644 --- a/docs/components/query.md +++ b/docs/components/query.md @@ -318,9 +318,6 @@ Flags: which data is deduplicated. Still you will be able to query without deduplication using 'dedup=false' parameter. - --query.max-samples=2147483647 - Maximum number of samples a single query can - load into memory. --selector-label=="" ... Query selector labels that will be exposed in info endpoint (repeated).