Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Aditi Ahuja <ahuja.aditi@gmail.com>
  • Loading branch information
metonymic-smokey committed Jul 31, 2022
1 parent 9763d25 commit 118d32f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions cmd/thanos/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func registerQuery(app *extkingpin.App) {
enableMetricMetadataPartialResponse := cmd.Flag("metric-metadata.partial-response", "Enable partial response for metric metadata endpoint. --no-metric-metadata.partial-response for disabling.").
Hidden().Default("true").Bool()

activeQueryDir := cmd.Flag("query.active-query-path", "Directory to log currently active queries in the queries.active file.").Default(".").String()
activeQueryDir := cmd.Flag("query.active-query-path", "Directory to log currently active queries in the queries.active file.").Default("").String()

featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable.The current list of features is "+queryPushdown+".").Default("").Strings()

Expand Down Expand Up @@ -422,6 +422,12 @@ func runQuery(
dns.ResolverType(dnsSDResolver),
)

var queryTracker *promql.ActiveQueryTracker
// Enabling query tracking only if the default path is not nil.
if activeQueryDir != "" {
queryTracker = promql.NewActiveQueryTracker(activeQueryDir, maxConcurrentQueries, logger)
}

var (
endpoints = query.NewEndpointSet(
time.Now,
Expand Down Expand Up @@ -472,8 +478,6 @@ func runQuery(
queryTimeout,
)

queryTracker = promql.NewActiveQueryTracker(activeQueryDir, maxConcurrentQueries, logger)

engineOpts = promql.EngineOpts{
Logger: logger,
Reg: reg,
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/e2ethanos/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,6 @@ func (q *QuerierBuilder) collectArgs() ([]string, error) {
args = append(args, "--store.sd-files="+filepath.Join(q.InternalDir(), "filesd.yaml"))
}

args = append(args, "--query.active-query-path="+q.InternalDir())

if q.routePrefix != "" {
args = append(args, "--web.route-prefix="+q.routePrefix)
}
Expand Down

0 comments on commit 118d32f

Please sign in to comment.