Max_look_back_period no more available in chunk.StoreConfig in Loki local-config.yaml

today I’ve updated my Grafana Loki container with latest image and it does not load config because of this error:

failed parsing config: /etc/loki/local-config.yaml: yaml: unmarshal errors:
  line 49: field max_look_back_period not found in type chunk.StoreConfig

Config is this:

  max_look_back_period: 336h

I gave a look at the source code and they’ve removed that parameter from chunk_store config, but official docs still mentions that parameter. I’ve set it equal to table_manager retention_period, is it something that shouldn’t be used or has it been replaced with another parameter? Actual chunk_store allows for these parameters looking at source code:

// StoreConfig specifies config for a ChunkStore
type StoreConfig struct {
	ChunkCacheConfig       cache.Config `yaml:"chunk_cache_config"`
	WriteDedupeCacheConfig cache.Config `yaml:"write_dedupe_cache_config"`

	CacheLookupsOlderThan model.Duration `yaml:"cache_lookups_older_than"`

	// Not visible in yaml because the setting shouldn't be common between ingesters and queriers.
	// This exists in case we don't want to cache all the chunks but still want to take advantage of
	// ingester chunk write deduplication. But for the queriers we need the full value. So when this option
	// is set, use different caches for ingesters and queriers.
	chunkCacheStubs bool // don't write the full chunk to cache, just a stub entry

	// When DisableIndexDeduplication is true and chunk is already there in cache, only index would be written to the store and not chunk.
	DisableIndexDeduplication bool `yaml:"-"`

(from loki/chunk_store.go at main · grafana/loki · GitHub)

This is what I’ve found in code history :

f.Var(&cfg.MaxLookBackPeriod, "store.max-look-back-period", "Deprecated: use -querier.max-query-lookback instead. Limit how long back data can be queried. This setting applies to chunks storage only.") // To be removed in Cortex 1.8.
1 Like

Thank you @nemric for the info!

I’m working on bringing back this, currently master is doing a breaking change, but we want to keep the config until the next major release.