Skip to content

Commit

Permalink
Rename config for enforcing a minimum number of label matchers (#8940)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:
Followup PR for #8918 renaming
config. See https://github.com/grafana/loki/pull/8918/files#r1151820792.

**Which issue(s) this PR fixes**:
Fixes grafana/loki-private#699

**Special notes for your reviewer**:

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [x] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`

---------

Co-authored-by: Dylan Guedes <djmgguedes@gmail.com>
  • Loading branch information
salvacorts and DylanGuedes committed Mar 30, 2023
1 parent abc0fd2 commit 28a7733
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/sources/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2502,10 +2502,10 @@ shard_streams:
[blocked_queries: <blocked_query...>]

# Define a list of required selector labels.
[required_label_matchers: <list of strings>]
[required_labels: <list of strings>]

# Minimum number of label matchers a query should contain.
[required_number_label_matchers: <int>]
[minimum_labels_number: <int>]
```

### frontend_worker
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/querylimits/propagation.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type QueryLimits struct {
MaxEntriesLimitPerQuery int `json:"maxEntriesLimitPerQuery,omitempty"`
QueryTimeout model.Duration `json:"queryTimeout,omitempty"`
RequiredLabels []string `json:"requiredLabels,omitempty"`
RequiredNumberLabels int `json:"requiredNumberLabelMatchers,omitempty"`
RequiredNumberLabels int `json:"minimumLabelsNumber,omitempty"`
MaxQueryBytesRead flagext.ByteSize `json:"maxQueryBytesRead,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/validation/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ type Limits struct {

BlockedQueries []*validation.BlockedQuery `yaml:"blocked_queries,omitempty" json:"blocked_queries,omitempty"`

RequiredLabels []string `yaml:"required_label_matchers,omitempty" json:"required_label_matchers,omitempty" doc:"description=Define a list of required selector labels."`
RequiredNumberLabels int `yaml:"required_number_label_matchers,omitempty" json:"required_number_label_matchers,omitempty" doc:"description=Minimum number of label matchers a query should contain."`
RequiredLabels []string `yaml:"required_labels,omitempty" json:"required_labels,omitempty" doc:"description=Define a list of required selector labels."`
RequiredNumberLabels int `yaml:"minimum_labels_number,omitempty" json:"minimum_labels_number,omitempty" doc:"description=Minimum number of label matchers a query should contain."`
}

type StreamRetention struct {
Expand Down

0 comments on commit 28a7733

Please sign in to comment.