Skip to content

Commit c95e7d1

Browse files
committed
query rejection
- query rejection configurations are added. It uses QueryAttributes which is used by priority queue - added tests. priority queue - priority queue was changed to include step, agent, dashboard, panel configs. Signed-off-by: Erlan Zholdubai uulu <[email protected]>
1 parent 6fe41ac commit c95e7d1

13 files changed

+770
-362
lines changed

docs/configuration/config-file-reference.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,10 +2928,6 @@ lifecycler:
29282928
# CLI flag: -ingester.active-series-metrics-idle-timeout
29292929
[active_series_metrics_idle_timeout: <duration> | default = 10m]
29302930
2931-
# Enable uploading compacted blocks.
2932-
# CLI flag: -ingester.upload-compacted-blocks-enabled
2933-
[upload_compacted_blocks_enabled: <boolean> | default = true]
2934-
29352931
instance_limits:
29362932
# Max ingestion rate (samples/sec) that ingester will accept. This limit is
29372933
# per-ingester, not per-tenant. Additional push requests will be rejected.
@@ -3172,9 +3168,9 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
31723168
# CLI flag: -ingester.max-global-series-per-metric
31733169
[max_global_series_per_metric: <int> | default = 0]
31743170
3175-
# [Experimental] Enable limits per LabelSet. Supported limits per labelSet:
3176-
# [max_series]
3177-
[limits_per_label_set: <list of LimitsPerLabelSet> | default = []]
3171+
# [Experimental] The maximum number of active series per LabelSet, across the
3172+
# cluster before replication. Empty list to disable.
3173+
[max_series_per_label_set: <list of MaxSeriesPerLabelSet> | default = []]
31783174
31793175
# The maximum number of active metrics with metadata per user, per ingester. 0
31803176
# to disable.
@@ -3276,6 +3272,14 @@ query_priority:
32763272

32773273
# List of priority definitions.
32783274
[priorities: <list of PriorityDef> | default = []]
3275+
3276+
query_rejection:
3277+
# Enables query rejection for tenant.
3278+
# CLI flag: -frontend.query-rejection.enabled
3279+
[enabled: <boolean> | default = false]
3280+
3281+
# List of query attributes that defines which queries should be rejected. Query will be rejected if it matches all the provided attributes
3282+
[query_attributes: <list of QueryAttribute> | default = []]
32793283

32803284
# Duration to delay the evaluation of rules to ensure the underlying metrics
32813285
# have been pushed to Cortex.
@@ -3644,6 +3648,11 @@ The `querier_config` configures the Cortex querier.
36443648
# CLI flag: -querier.query-ingesters-within
36453649
[query_ingesters_within: <duration> | default = 0s]
36463650
3651+
# Deprecated (Querying long-term store for labels will be always enabled in the
3652+
# future.): Query long-term store for series, label values and label names APIs.
3653+
# CLI flag: -querier.query-store-for-labels-enabled
3654+
[query_store_for_labels_enabled: <boolean> | default = false]
3655+
36473656
# Enable returning samples stats per steps in query response.
36483657
# CLI flag: -querier.per-step-stats-enabled
36493658
[per_step_stats_enabled: <boolean> | default = false]
@@ -4262,11 +4271,6 @@ ring:
42624271
# CLI flag: -ruler.ring.zone-awareness-enabled
42634272
[zone_awareness_enabled: <boolean> | default = false]
42644273
4265-
# EXPERIMENTAL: File path where tokens are stored. If empty, tokens are not
4266-
# stored at shutdown and restored at startup.
4267-
# CLI flag: -ruler.ring.tokens-file-path
4268-
[tokens_file_path: <string> | default = ""]
4269-
42704274
# Name of network interface to read address from.
42714275
# CLI flag: -ruler.ring.instance-interface-names
42724276
[instance_interface_names: <list of string> | default = [eth0 en0]]
@@ -5314,14 +5318,11 @@ otel:
53145318
[tls_insecure_skip_verify: <boolean> | default = false]
53155319
```
53165320
5317-
### `LimitsPerLabelSet`
5321+
### `MaxSeriesPerLabelSet`
53185322

53195323
```yaml
5320-
limits:
5321-
# The maximum number of active series per LabelSet, across the cluster before
5322-
# replication. Setting the value 0 will enable the monitoring (metrics) but
5323-
# would not enforce any limits.
5324-
[max_series: <int> | default = ]
5324+
# The maximum number of active series per LabelSet before replication.
5325+
[limit: <int> | default = ]
53255326
53265327
# LabelSet which the limit should be applied.
53275328
[label_set: <map of string (labelName) to string (labelValue)> | default = []]
@@ -5360,6 +5361,22 @@ time_window:
53605361
# lookback delta) that the query should be within. If set to 0, it won't be
53615362
# checked.
53625363
[end: <int> | default = 0]
5364+
5365+
# Limit that query step should be within. If not set it won't be checked
5366+
query_step_limit:
5367+
# Query step should be above or equal to this value to match. If set to 0, it won't be checked.
5368+
[min: <duration> | default = 0]
5369+
# Query step should be below or equal to this value to match. If set to 0, it won't be checked.
5370+
[max: <duration> | default = 0]
5371+
5372+
# Query's User-Agent should match this value. If not set, it won't be checked
5373+
[user_agent: <string> | default = ""]
5374+
5375+
# Query's X-Dashboard-Uid should match this value. If not set, it won't be checked
5376+
[dashboard_uid: <string> | default = ""]
5377+
5378+
# Query's X-Panel-Id should match this value. If not set, it won't be checked
5379+
[panel_id: <string> | default = ""]
53635380
```
53645381

53655382
### `DisabledRuleGroup`

pkg/querier/tripperware/limits.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ type Limits interface {
2828

2929
// QueryPriority returns the query priority config for the tenant, including different priorities and their attributes.
3030
QueryPriority(userID string) validation.QueryPriority
31+
32+
QueryRejection(userID string) validation.QueryRejection
3133
}

pkg/querier/tripperware/priority.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

pkg/querier/tripperware/priority_test.go

Lines changed: 0 additions & 222 deletions
This file was deleted.

0 commit comments

Comments
 (0)