Skip to content

Commit

Permalink
fix head series limiter trigger (thanos-io#6802)
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
  • Loading branch information
thibaultmg authored and coleenquadros committed Oct 19, 2023
1 parent 33d4f93 commit 6a97e05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit 6a97e05

Please sign in to comment.