diff --git a/CHANGELOG.md b/CHANGELOG.md index cf8ee984bb0..bac33d356c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) \ No newline at end of file +* [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) diff --git a/cmd/tempo/app/app.go b/cmd/tempo/app/app.go index 5ff5402b95d..106cc0d1314 100644 --- a/cmd/tempo/app/app.go +++ b/cmd/tempo/app/app.go @@ -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 diff --git a/cmd/tempo/main.go b/cmd/tempo/main.go index 4670e22034e..277d994be65 100644 --- a/cmd/tempo/main.go +++ b/cmd/tempo/main.go @@ -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 {