From 28a7733edeb6eddff99952b98fcba2121f78ed37 Mon Sep 17 00:00:00 2001 From: Salva Corts Date: Thu, 30 Mar 2023 11:00:58 +0200 Subject: [PATCH] Rename config for enforcing a minimum number of label matchers (#8940) **What this PR does / why we need it**: Followup PR for https://github.com/grafana/loki/pull/8918 renaming config. See https://github.com/grafana/loki/pull/8918/files#r1151820792. **Which issue(s) this PR fixes**: Fixes https://github.com/grafana/loki-private/issues/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 --- docs/sources/configuration/_index.md | 4 ++-- pkg/util/querylimits/propagation.go | 2 +- pkg/validation/limits.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/configuration/_index.md b/docs/sources/configuration/_index.md index adf9398a70..6cc2e3dd2f 100644 --- a/docs/sources/configuration/_index.md +++ b/docs/sources/configuration/_index.md @@ -2502,10 +2502,10 @@ shard_streams: [blocked_queries: ] # Define a list of required selector labels. -[required_label_matchers: ] +[required_labels: ] # Minimum number of label matchers a query should contain. -[required_number_label_matchers: ] +[minimum_labels_number: ] ``` ### frontend_worker diff --git a/pkg/util/querylimits/propagation.go b/pkg/util/querylimits/propagation.go index 76d0cd2c75..724ecacd89 100644 --- a/pkg/util/querylimits/propagation.go +++ b/pkg/util/querylimits/propagation.go @@ -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"` } diff --git a/pkg/validation/limits.go b/pkg/validation/limits.go index 026347ab48..d1d2aac9fc 100644 --- a/pkg/validation/limits.go +++ b/pkg/validation/limits.go @@ -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 {