github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/pkg/ruler/storage/cleaner/config.go (about) 1 // This directory was copied and adapted from https://github.com/grafana/agent/tree/main/pkg/metrics. 2 // We cannot vendor the agent in since the agent vendors loki in, which would cause a cyclic dependency. 3 // NOTE: many changes have been made to the original code for our use-case. 4 package cleaner 5 6 import ( 7 "flag" 8 "time" 9 ) 10 11 // Config specifies the configurable settings of the WAL cleaner 12 type Config struct { 13 MinAge time.Duration `yaml:"min_age,omitempty"` 14 Period time.Duration `yaml:"period,omitempty"` 15 } 16 17 func (c Config) RegisterFlags(f *flag.FlagSet) { 18 f.DurationVar(&c.MinAge, "ruler.wal-cleaner.min-age", DefaultCleanupAge, "The minimum age of a WAL to consider for cleaning.") 19 f.DurationVar(&c.Period, "ruler.wal-cleaer.period", DefaultCleanupPeriod, "How often to run the WAL cleaner.") 20 }