* Remove validity from FIFO cache
We can remove the validity setting of 1h in 2.4 for the
chunks cache because it doesn't reduce memory usage and instead leads to
valid chunks being ignore when querying the cache. Chunks are immutable
so it doesn't make sense to not return them if they are present in the
cache.
Closes#4922
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
* Add periodic task to prune old FIFO cache elements
As described in #4921 this PR adds a periodic task that prunes expired
items from the FIFO cache to free up memory.
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
* Apply suggestions from code review
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
* [5262](https://github.com/grafana/loki/pull/5262) **MichelHollands**: Remove the labelFilter field
* [4911](https://github.com/grafana/loki/pull/4911) **jeschkies**: Support Docker service discovery in Promtail.
* [5107](https://github.com/grafana/loki/pull/5107) **chaudum** Fix bug in fluentd plugin that caused log lines containing non UTF-8 characters to be dropped.
* [5148](https://github.com/grafana/loki/pull/5148) **chaudum** Add periodic task to prune old expired items from the FIFO cache to free up memory.
* [5187](https://github.com/grafana/loki/pull/5187) **aknuds1** Rename metric `cortex_experimental_features_in_use_total` to `loki_experimental_features_in_use_total` and metric `log_messages_total` to `loki_log_messages_total`.
* [5170](https://github.com/grafana/loki/pull/5170) **chaudum** Fix deadlock in Promtail caused when targets got removed from a target group by the discovery manager.
* [5163](https://github.com/grafana/loki/pull/5163) **chaudum** Fix regression in fluentd plugin introduced with #5107 that caused `NoMethodError` when parsing non-string values of log lines.
f.StringVar(&cfg.MaxSizeBytes,prefix+"fifocache.max-size-bytes","1GB",description+"Maximum memory size of the cache in bytes. A unit suffix (KB, MB, GB) may be applied.")
f.IntVar(&cfg.MaxSizeItems,prefix+"fifocache.max-size-items",0,description+"Maximum number of entries in the cache.")
f.DurationVar(&cfg.Validity,prefix+"fifocache.duration",time.Hour,description+"The expiry duration for the cache.")
f.DurationVar(&cfg.TTL,prefix+"fifocache.ttl",time.Hour,description+"The time to live for items in the cache before they get purged.")
f.IntVar(&cfg.DeprecatedSize,prefix+"fifocache.size",0,"Deprecated (use max-size-items or max-size-bytes instead): "+description+"The number of entries to cache. ")
f.DurationVar(&cfg.DeprecatedValidity,prefix+"fifocache.duration",0,"Deprecated (use ttl instead): "+description+"The expiry duration for the cache.")
f.IntVar(&cfg.DeprecatedSize,prefix+"fifocache.size",0,"Deprecated (use max-size-items or max-size-bytes instead): "+description+"The number of entries to cache.")