Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
  • Loading branch information
krasi-georgiev committed Sep 7, 2020
1 parent a2ff3f6 commit f152db6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/thanos/query-frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func runQueryFrontend(
MaxCacheFreshness: cfg.Limits.MaxCacheFreshness,
}, nil)
if err != nil {
return errors.Wrap(err, "initialiase limits")
return errors.Wrap(err, "initialize limits")
}

codec := queryfrontend.NewThanosCodec(cfg.partialResponseStrategy)
Expand Down
2 changes: 1 addition & 1 deletion docs/components/query-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ It uses the cortex cache module so supports all that is supported there.
### Slow Query Log
Query Frontend supports `--query-frontend.log_queries_longer_than` flag to log queries running longer then some duration.
Query Frontend supports `--query-frontend.log_queries_longer_than` flag to log queries running longer than some duration.

## Naming

Expand Down
10 changes: 8 additions & 2 deletions pkg/queryfrontend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ type QueryRange struct {
// Validate validates the config.
func (cfg *QueryRange) Validate() error {
if cfg.ResultsCacheConfig != (queryrange.ResultsCacheConfig{}) {
if cfg.SplitQueriesByInterval <= 0 {
return errors.New("split queries interval should be greater then 0")
}
if err := cfg.ResultsCacheConfig.CacheConfig.Validate(); err != nil {
return errors.Wrap(err, "invalid ResultsCache config")
}
Expand All @@ -50,7 +53,10 @@ type Config struct {

// Validate validates the config.
func (cfg *Config) Validate() error {
err := errors.Wrapf(cfg.QueryRange.Validate(), "query range config validation")
err = errors.Wrapf(cfg.Frontend.Validate(), "frontend config validation")
err := errors.Wrap(cfg.QueryRange.Validate(), "query range config validation")
if err != nil {
return err
}
err = errors.Wrap(cfg.Frontend.Validate(), "frontend config validation")
return err
}
2 changes: 1 addition & 1 deletion scripts/cfggen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func main() {
os.Exit(1)
}

if err := generate([]cache.Config{cache.Config{}}, "frontend_cache", *outputDir); err != nil {
if err := generate([]cache.Config{{}}, "frontend_cache", *outputDir); err != nil {
level.Error(logger).Log("msg", "failed to generate", "type", "frontend_cache", "err", err)
os.Exit(1)
}
Expand Down

0 comments on commit f152db6

Please sign in to comment.