Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warnings for suspect configurations #294

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion 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)
* [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
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
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
dgzlopes marked this conversation as resolved.
Show resolved Hide resolved
config.CheckConfig()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the check to its own method. I'm not sure if the method name is descriptive enough 😅

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