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

Deprecate CLI flag -ruler.wal-cleaer.period in favor of CLI flag -ruler.wal-cleaner.period #7937

Merged
merged 3 commits into from
Dec 14, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [7708](https://github.com/grafana/loki/pull/7708) **DylanGuedes**: Fix multitenant querying.
* [7784](https://github.com/grafana/loki/pull/7784) **isodude**: Fix default values of connect addresses for compactor and querier workers to work with IPv6.
* [7880](https://github.com/grafana/loki/pull/7880) **sandeepsukhani**: consider range and offset in queries while looking for schema config for query sharding.
* [7937](https://github.com/grafana/loki/pull/7937) **ssncferreira**: Deprecate CLI flag `-ruler.wal-cleaer.period` and replace it with `-ruler.wal-cleaner.period`.
* [7906](https://github.com/grafana/loki/pull/7906) **kavirajk**: Add API endpoint that formats LogQL expressions and support new `fmt` subcommand in `logcli` to format LogQL query.

##### Changes
Expand Down
5 changes: 4 additions & 1 deletion docs/sources/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,11 @@ wal_cleaner:
# CLI flag: -ruler.wal-cleaner.min-age
[min_age: <duration> | default = 12h]

# Deprecated: CLI flag -ruler.wal-cleaer.period.
# Use -ruler.wal-cleaner.period instead.
#
# How often to run the WAL cleaner. 0 = disabled.
# CLI flag: -ruler.wal-cleaer.period
# CLI flag: -ruler.wal-cleaner.period
[period: <duration> | default = 0s]

# Remote-write configuration to send rule samples to a Prometheus remote-write
Expand Down
13 changes: 13 additions & 0 deletions docs/sources/upgrading/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ go build ./clients/cmd/promtail --tags=promtail_journal_enabled
```
Introducing this tag aims to relieve Linux/CentOS users with CGO enabled from installing libsystemd-dev/systemd-devel libraries if they don't need Journal support.

### Ruler

#### CLI flag `ruler.wal-cleaer.period` deprecated

CLI flag `ruler.wal-cleaer.period` is now deprecated and replaced with a typo fix `ruler.wal-cleaner.period`.
The yaml configuration remains unchanged:

```yaml
ruler:
wal_cleaner:
period: 5s
```

## 2.7.0

### Loki
Expand Down
4 changes: 4 additions & 0 deletions pkg/ruler/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func (c *Config) Validate() error {
return fmt.Errorf("invalid ruler remote-write config: %w", err)
}

if err := c.WALCleaner.Validate(); err != nil {
return fmt.Errorf("invalid ruler wal cleaner config: %w", err)
}

return nil
}

Expand Down
16 changes: 15 additions & 1 deletion pkg/ruler/storage/cleaner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@ import (
type Config struct {
MinAge time.Duration `yaml:"min_age,omitempty"`
Period time.Duration `yaml:"period,omitempty"`
// Deprecated
// TODO(ssncferreira): remove on next major version
DeprecatedPeriod time.Duration `doc:"hidden"`
}

func (c *Config) RegisterFlags(f *flag.FlagSet) {
f.DurationVar(&c.MinAge, "ruler.wal-cleaner.min-age", DefaultCleanupAge, "The minimum age of a WAL to consider for cleaning.")
f.DurationVar(&c.Period, "ruler.wal-cleaer.period", DefaultCleanupPeriod, "How often to run the WAL cleaner. 0 = disabled.")
f.DurationVar(&c.Period, "ruler.wal-cleaner.period", DefaultCleanupPeriod, "Deprecated: CLI flag -ruler.wal-cleaer.period.\nUse -ruler.wal-cleaner.period instead.\n\nHow often to run the WAL cleaner. 0 = disabled.")

// Deprecated: typo replaced by c.Period
// TODO(ssncferreira): remove on next major version
f.DurationVar(&c.DeprecatedPeriod, "ruler.wal-cleaer.period", DefaultCleanupPeriod, "Deprecated: CLI flag -ruler.wal-cleaer.period.\nUse -ruler.wal-cleaner.period instead.")
}

func (c *Config) Validate() error {
if c.DeprecatedPeriod != DefaultCleanupPeriod && c.Period == DefaultCleanupPeriod {
c.Period = c.DeprecatedPeriod
}
return nil
}