Skip to content

Commit

Permalink
Add warnings for suspect configurations (#294)
Browse files Browse the repository at this point in the history
* Add warning for suspect configurations

Signed-off-by: Daniel González Lopes <[email protected]>

* Add to changelog

Signed-off-by: Daniel González Lopes <[email protected]>

* Move config check to its own method

Signed-off-by: Daniel González Lopes <[email protected]>
  • Loading branch information
dgzlopes authored Nov 2, 2020
1 parent 38d2440 commit 077fd13
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## master / unreleased

* [CHANGE] Bloom filters are now sharded to reduce size and improve caching, as blocks grow. This is a **breaking change** and all data stored before this change will **not** be queryable. [192](https://github.com/grafana/tempo/pull/192)
* [ENHANCEMENT] CI checks for vendored dependencies using `make vendor-check`. Update CONTRIBUTING.md to reflect the same before checking in files in a PR. [#274](https://github.com/grafana/tempo/pull/274)
* [ENHANCEMENT] CI checks for vendored dependencies using `make vendor-check`. Update CONTRIBUTING.md to reflect the same before checking in files in a PR. [#274](https://github.com/grafana/tempo/pull/274)
* [ENHANCEMENT] Add warnings for suspect configs. [#294](https://github.com/grafana/tempo/pull/294)
13 changes: 13 additions & 0 deletions cmd/tempo/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ func (c *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) {

}

// CheckConfig checks if config values are suspect.
func (c *Config) CheckConfig() {
if c.Ingester.CompleteBlockTimeout < c.StorageConfig.Trace.MaintenanceCycle {
level.Warn(util.Logger).Log("msg", "3ingester.CompleteBlockTimeout < storage.trace.maintenance-cycle",
"explan", "You may receive 404s between the time the ingesters have flushed a trace and the querier is aware of the new block")
}

if c.Compactor.Compactor.BlockRetention < c.StorageConfig.Trace.MaintenanceCycle {
level.Warn(util.Logger).Log("msg", "compactor.CompactedBlockRetention < storage.trace.maintenance-cycle",
"explan", "Queriers and Compactors may attempt to read a block that no longer exists")
}
}

// App is the root datastructure.
type App struct {
cfg Config
Expand Down
3 changes: 3 additions & 0 deletions cmd/tempo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func main() {
// Allocate a block of memory to alter GC behaviour. See https://github.com/golang/go/issues/23044
ballast := make([]byte, *ballastMBs*1024*1024)

// Warn the user for suspect configurations
config.CheckConfig()

// Start Tempo
t, err := app.New(*config)
if err != nil {
Expand Down

0 comments on commit 077fd13

Please sign in to comment.