Skip to content

Commit

Permalink
Add CLI flags for promql options
Browse files Browse the repository at this point in the history
This fixes #20
  • Loading branch information
jacksontj committed Apr 25, 2018
1 parent 5bc4b74 commit 0e73227
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/promxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ var opts struct {
BindAddr string `long:"bind-addr" description:"address for promxy to listen on" default:":8082"`
ConfigFile string `long:"config" description:"path to the config file" required:"true"`
LogLevel string `long:"log-level" description:"Log level" default:"info"`

QueryTimeout time.Duration `long:"query.timeout" description:"Maximum time a query may take before being aborted." default:"2m"`
QueryMaxConcurrency int `long:"query.max-concurrency" description:"Maximum number of queries executed concurrently." default:"1000"`
}

func reloadConfig(rls ...proxyconfig.Reloadable) error {
Expand Down Expand Up @@ -111,8 +114,7 @@ func main() {
proxyStorage = ps

// TODO: config for the timeout
engine := promql.NewEngine(nil, prometheus.DefaultRegisterer, 20, 120*time.Second)

engine := promql.NewEngine(nil, prometheus.DefaultRegisterer, opts.QueryMaxConcurrency, opts.QueryTimeout)
engine.NodeReplacer = ps.NodeReplacer

// TODO: config option
Expand Down

0 comments on commit 0e73227

Please sign in to comment.