Skip to content

Commit

Permalink
Add default values
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel González Lopes <[email protected]>
  • Loading branch information
dgzlopes committed Apr 13, 2021
1 parent fb63db3 commit 81cf202
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
5 changes: 5 additions & 0 deletions modules/storage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"
"time"

cortex_cache "github.com/cortexproject/cortex/pkg/chunk/cache"
"github.com/grafana/tempo/pkg/util"
"github.com/grafana/tempo/tempodb"
"github.com/grafana/tempo/tempodb/backend"
Expand Down Expand Up @@ -62,6 +63,10 @@ func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)
cfg.Trace.Local = &local.Config{}
f.StringVar(&cfg.Trace.Local.Path, util.PrefixConfig(prefix, "trace.local.path"), "", "path to store traces at.")

cfg.Trace.BackgroundCache = &cortex_cache.BackgroundConfig{}
f.IntVar(&cfg.Trace.BackgroundCache.WriteBackBuffer, util.PrefixConfig(prefix, "trace.background_cache.writeback_buffer"), 10000, "Key batches to buffer for background write-back.")
f.IntVar(&cfg.Trace.BackgroundCache.WriteBackGoroutines, util.PrefixConfig(prefix, "trace.background_cache.writeback_goroutines"), 10, "Concurrency to write back to cache.")

cfg.Trace.Pool = &pool.Config{}
f.IntVar(&cfg.Trace.Pool.MaxWorkers, util.PrefixConfig(prefix, "trace.pool.max-workers"), 50, "Workers in the worker pool.")
f.IntVar(&cfg.Trace.Pool.QueueDepth, util.PrefixConfig(prefix, "trace.pool.queue-depth"), 200, "Work item queue depth.")
Expand Down
6 changes: 0 additions & 6 deletions tempodb/backend/cache/memcached/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ func NewClient(cfg *Config, cfgBackground *cortex_cache.BackgroundConfig, logger
if cfg.ClientConfig.UpdateInterval == 0 {
cfg.ClientConfig.UpdateInterval = time.Minute
}
if cfgBackground == nil {
cfgBackground = &cortex_cache.BackgroundConfig{
WriteBackGoroutines: 10,
WriteBackBuffer: 1000,
}
}

client := cortex_cache.NewMemcachedClient(cfg.ClientConfig, "tempo", prometheus.DefaultRegisterer, logger)
memcachedCfg := cortex_cache.MemcachedConfig{
Expand Down
6 changes: 0 additions & 6 deletions tempodb/backend/cache/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ func NewClient(cfg *Config, cfgBackground *cortex_cache.BackgroundConfig, logger
if cfg.ClientConfig.Expiration == 0 {
cfg.ClientConfig.Expiration = cfg.TTL
}
if cfgBackground == nil {
cfgBackground = &cortex_cache.BackgroundConfig{
WriteBackGoroutines: 10,
WriteBackBuffer: 1000,
}
}

client := cortex_cache.NewRedisClient(&cfg.ClientConfig)
cache := cortex_cache.NewRedisCache("tempo", client, logger)
Expand Down

0 comments on commit 81cf202

Please sign in to comment.