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

receive: fix head series limiter trigger from settings #6802

Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Fixed

- [#6802](https://github.com/thanos-io/thanos/pull/6802) Receive: head series limiter should not run if no head series limit is set.

### Added

- [#6605](https://github.com/thanos-io/thanos/pull/6605) Query Frontend: Support vertical sharding binary expression with metric name when no matching labels specified.
Expand Down
14 changes: 12 additions & 2 deletions pkg/receive/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,18 @@ func (l *Limiter) loadConfig() error {
l.registerer,
&config.WriteLimits,
)
seriesLimitSupported := (l.receiverMode == RouterOnly || l.receiverMode == RouterIngestor) && (len(config.WriteLimits.TenantsLimits) != 0 || config.WriteLimits.DefaultLimits.HeadSeriesLimit != 0)
if seriesLimitSupported {
seriesLimitIsActivated := func() bool {
if config.WriteLimits.DefaultLimits.HeadSeriesLimit != 0 {
return true
}
for _, tenant := range config.WriteLimits.TenantsLimits {
if tenant.HeadSeriesLimit != nil && *tenant.HeadSeriesLimit != 0 {
return true
}
}
return false
}
if (l.receiverMode == RouterOnly || l.receiverMode == RouterIngestor) && seriesLimitIsActivated() {
l.HeadSeriesLimiter = NewHeadSeriesLimit(config.WriteLimits, l.registerer, l.logger)
}
return nil
Expand Down
Loading