operator: Expose limits config setting cardinality_limit (#9830)

pull/9791/head
Periklis Tsirakidis 3 years ago committed by GitHub
parent 125e168a91
commit bcdc807dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      operator/CHANGELOG.md
  2. 7
      operator/apis/loki/v1/lokistack_types.go
  3. 12
      operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml
  4. 10
      operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml
  5. 12
      operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml
  6. 10
      operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml
  7. 12
      operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml
  8. 10
      operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml
  9. 10
      operator/config/crd/bases/loki.grafana.com_lokistacks.yaml
  10. 10
      operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml
  11. 10
      operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml
  12. 10
      operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml
  13. 12
      operator/docs/operator/api.md
  14. 10
      operator/internal/manifests/internal/config/build_test.go
  15. 2
      operator/internal/manifests/internal/config/loki-config.yaml
  16. 3
      operator/internal/manifests/internal/config/loki-runtime-config.yaml
  17. 4
      operator/internal/manifests/internal/sizes.go

@ -1,5 +1,6 @@
## Main
- [9830](https://github.com/grafana/loki/pull/9830) **periklis**: Expose limits config setting cardinality_limit
- [9600](https://github.com/grafana/loki/pull/9600) **periklis**: Add rules labels filters for openshift-logging application tenant
- [9735](https://github.com/grafana/loki/pull/9735) **JoaoBraveCoding** Adjust 1x.extra-small resources according to findings
- [9689](https://github.com/grafana/loki/pull/9689) **xperimental**: Fix availability of demo LokiStack size

@ -564,6 +564,13 @@ type QueryLimitSpec struct {
// +kubebuilder:default:="3m"
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Query Timeout"
QueryTimeout string `json:"queryTimeout,omitempty"`
// CardinalityLimit defines the cardinality limit for index queries.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:number",displayName="Cardinality Limit"
CardinalityLimit int32 `json:"cardinalityLimit,omitempty"`
}
// IngestionLimitSpec defines the limits applied at the ingestion path.

@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:main-ac1c1fd
createdAt: "2023-06-12T17:36:46Z"
createdAt: "2023-06-29T17:58:18Z"
description: The Community Loki Operator provides Kubernetes native deployment
and management of Loki and related logging components.
operators.operatorframework.io/builder: operator-sdk-unknown
@ -341,6 +341,11 @@ spec:
path: limits.global.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.global.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query
@ -420,6 +425,11 @@ spec:
path: limits.tenants.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.tenants.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query

@ -145,6 +145,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.
@ -267,6 +272,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.

@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:main-ac1c1fd
createdAt: "2023-06-12T17:36:41Z"
createdAt: "2023-06-29T17:58:15Z"
description: The Community Loki Operator provides Kubernetes native deployment
and management of Loki and related logging components.
operators.operatorframework.io/builder: operator-sdk-unknown
@ -341,6 +341,11 @@ spec:
path: limits.global.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.global.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query
@ -420,6 +425,11 @@ spec:
path: limits.tenants.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.tenants.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query

@ -145,6 +145,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.
@ -267,6 +272,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.

@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: quay.io/openshift-logging/loki-operator:v0.1.0
createdAt: "2023-06-12T17:36:51Z"
createdAt: "2023-06-29T17:58:20Z"
description: |
The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging.
## Prerequisites and Requirements
@ -354,6 +354,11 @@ spec:
path: limits.global.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.global.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query
@ -433,6 +438,11 @@ spec:
path: limits.tenants.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.tenants.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query

@ -145,6 +145,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.
@ -267,6 +272,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.

@ -128,6 +128,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.
@ -250,6 +255,11 @@ spec:
description: QueryLimits defines the limit applied on querying
log streams.
properties:
cardinalityLimit:
description: CardinalityLimit defines the cardinality
limit for index queries.
format: int32
type: integer
maxChunksPerQuery:
description: MaxChunksPerQuery defines the maximum number
of chunks that can be fetched by a single query.

@ -254,6 +254,11 @@ spec:
path: limits.global.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.global.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query
@ -333,6 +338,11 @@ spec:
path: limits.tenants.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.tenants.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query

@ -254,6 +254,11 @@ spec:
path: limits.global.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.global.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query
@ -333,6 +338,11 @@ spec:
path: limits.tenants.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.tenants.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query

@ -266,6 +266,11 @@ spec:
path: limits.global.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.global.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query
@ -345,6 +350,11 @@ spec:
path: limits.tenants.ingestion.perStreamRateLimitBurst
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: CardinalityLimit defines the cardinality limit for index queries.
displayName: Cardinality Limit
path: limits.tenants.queries.cardinalityLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxChunksPerQuery defines the maximum number of chunks that can
be fetched by a single query.
displayName: Max Chunk per Query

@ -2641,6 +2641,18 @@ string
<p>Timeout when querying ingesters or storage during the execution of a query request.</p>
</td>
</tr>
<tr>
<td>
<code>cardinalityLimit</code><br/>
<em>
int32
</em>
</td>
<td>
<em>(Optional)</em>
<p>CardinalityLimit defines the cardinality limit for index queries.</p>
</td>
</tr>
</tbody>
</table>

@ -198,6 +198,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
},
@ -454,6 +455,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
Tenants: map[string]lokiv1.LimitsTemplateSpec{
@ -863,6 +865,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
},
@ -1215,6 +1218,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
},
@ -1581,6 +1585,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
},
@ -1915,6 +1920,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
Retention: &lokiv1.RetentionLimitSpec{
Days: 15,
@ -2305,6 +2311,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "2m",
CardinalityLimit: 100000,
},
},
},
@ -2696,6 +2703,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
},
@ -3086,6 +3094,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "2m",
CardinalityLimit: 100000,
},
},
},
@ -3470,6 +3479,7 @@ overrides:
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
},
},
},

@ -162,7 +162,7 @@ limits_config:
max_query_length: 721h
max_query_parallelism: 32
max_query_series: {{ .Stack.Limits.Global.QueryLimits.MaxQuerySeries }}
cardinality_limit: 100000
cardinality_limit: {{ .Stack.Limits.Global.QueryLimits.CardinalityLimit }}
max_streams_matchers_per_query: 1000
query_timeout: {{ .Stack.Limits.Global.QueryLimits.QueryTimeout }}
{{- if .Retention.Enabled }}{{- with .Stack.Limits.Global.Retention }}

@ -46,6 +46,9 @@ overrides:
{{- if $spec.QueryLimits.QueryTimeout }}
query_timeout: {{ $spec.QueryLimits.QueryTimeout }}
{{- end }}
{{- if $spec.QueryLimits.CardinalityLimit }}
cardinality_limit: {{ $spec.QueryLimits.CardinalityLimit }}
{{- end }}
{{- end -}}
{{- with $spec.Retention }}
retention_period: {{ .Days }}d

@ -250,6 +250,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "3m",
CardinalityLimit: 100000,
},
},
},
@ -304,6 +305,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "3m",
CardinalityLimit: 100000,
},
},
},
@ -361,6 +363,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "3m",
CardinalityLimit: 100000,
},
},
},
@ -418,6 +421,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxChunksPerQuery: 2000000,
MaxQuerySeries: 500,
QueryTimeout: "3m",
CardinalityLimit: 100000,
},
},
},

Loading…
Cancel
Save