Skip to content

Commit

Permalink
Revert "add flag max query samples (#1369)" (#2043)
Browse files Browse the repository at this point in the history
This reverts commit 912e101.
  • Loading branch information
bwplotka committed Jan 26, 2020
1 parent cf4e450 commit cedea11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 4 additions & 8 deletions cmd/thanos/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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("<name>=\"<value>\"").Strings()

Expand Down Expand Up @@ -161,7 +158,6 @@ func registerQuery(m map[string]setupFunc, app *kingpin.Application) {
time.Duration(*unhealthyStoreTimeout),
time.Duration(*instantDefaultMaxSourceResolution),
component.Query,
*maxQuerySamples,
)
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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,
},
)
)
Expand Down
3 changes: 0 additions & 3 deletions docs/components/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<name>="<value>" ...
Query selector labels that will be exposed in
info endpoint (repeated).
Expand Down

0 comments on commit cedea11

Please sign in to comment.