Skip to content

Commit

Permalink
feat(operator): Add support for the volume API (grafana#13369)
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinsu authored and periklis committed Jul 3, 2024
1 parent 7a3abe1 commit 98071b1
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 0 deletions.
6 changes: 6 additions & 0 deletions operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
## Main

## Release 5.6.21

- [13369](https://github.com/grafana/loki/pull/13369) **jatinsu**: feat(operator): Add support for the volume API

## Release 5.6.20

No changes.

- [13066](https://github.com/grafana/loki/pull/13066) **xperimental**: Use a minimum value for replay memory ceiling

## Release 5.6.19
Expand Down
7 changes: 7 additions & 0 deletions operator/apis/loki/v1/lokistack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,13 @@ type QueryLimitSpec struct {
// +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"`

// MaxVolumeSeries defines the maximum number of aggregated series in a log-volume response
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:number",displayName="Max Volume Series"
MaxVolumeSeries int32 `json:"maxVolumeSeries,omitempty"`
}

// IngestionLimitSpec defines the limits applied at the ingestion path.
Expand Down
12 changes: 12 additions & 0 deletions operator/bundle/manifests/loki-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ spec:
path: limits.global.queries.maxQuerySeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxVolumeSeries defines the maximum number of aggregated series
in a log-volume response
displayName: Max Volume Series
path: limits.global.queries.maxVolumeSeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: Timeout when querying ingesters or storage during the execution
of a query request.
displayName: Query Timeout
Expand Down Expand Up @@ -474,6 +480,12 @@ spec:
path: limits.tenants.queries.maxQuerySeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxVolumeSeries defines the maximum number of aggregated series
in a log-volume response
displayName: Max Volume Series
path: limits.tenants.queries.maxVolumeSeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: Timeout when querying ingesters or storage during the execution
of a query request.
displayName: Query Timeout
Expand Down
10 changes: 10 additions & 0 deletions operator/bundle/manifests/loki.grafana.com_lokistacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ spec:
unique series that is returned by a metric query.
format: int32
type: integer
maxVolumeSeries:
description: MaxVolumeSeries defines the maximum number
of aggregated series in a log-volume response
format: int32
type: integer
queryTimeout:
default: 3m
description: Timeout when querying ingesters or storage
Expand Down Expand Up @@ -298,6 +303,11 @@ spec:
of unique series that is returned by a metric query.
format: int32
type: integer
maxVolumeSeries:
description: MaxVolumeSeries defines the maximum number
of aggregated series in a log-volume response
format: int32
type: integer
queryTimeout:
default: 3m
description: Timeout when querying ingesters or storage
Expand Down
10 changes: 10 additions & 0 deletions operator/config/crd/bases/loki.grafana.com_lokistacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ spec:
unique series that is returned by a metric query.
format: int32
type: integer
maxVolumeSeries:
description: MaxVolumeSeries defines the maximum number
of aggregated series in a log-volume response
format: int32
type: integer
queryTimeout:
default: 3m
description: Timeout when querying ingesters or storage
Expand Down Expand Up @@ -281,6 +286,11 @@ spec:
of unique series that is returned by a metric query.
format: int32
type: integer
maxVolumeSeries:
description: MaxVolumeSeries defines the maximum number
of aggregated series in a log-volume response
format: int32
type: integer
queryTimeout:
default: 3m
description: Timeout when querying ingesters or storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ spec:
path: limits.global.queries.maxQuerySeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxVolumeSeries defines the maximum number of aggregated series
in a log-volume response
displayName: Max Volume Series
path: limits.global.queries.maxVolumeSeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: Timeout when querying ingesters or storage during the execution
of a query request.
displayName: Query Timeout
Expand Down Expand Up @@ -329,6 +335,12 @@ spec:
path: limits.tenants.queries.maxQuerySeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxVolumeSeries defines the maximum number of aggregated series
in a log-volume response
displayName: Max Volume Series
path: limits.tenants.queries.maxVolumeSeries
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: Timeout when querying ingesters or storage during the execution
of a query request.
displayName: Query Timeout
Expand Down
12 changes: 12 additions & 0 deletions operator/docs/operator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,18 @@ int32
<p>CardinalityLimit defines the cardinality limit for index queries.</p>
</td>
</tr>
<tr>
<td>
<code>maxVolumeSeries</code><br/>
<em>
int32
</em>
</td>
<td>
<em>(Optional)</em>
<p>MaxVolumeSeries defines the maximum number of aggregated series in a log-volume response</p>
</td>
</tr>
</tbody>
</table>

Expand Down
30 changes: 30 additions & 0 deletions operator/internal/manifests/internal/config/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -197,6 +199,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -359,6 +362,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -452,6 +457,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
Tenants: map[string]lokiv1.LimitsTemplateSpec{
Expand Down Expand Up @@ -701,6 +707,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -843,6 +851,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -1052,6 +1061,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -1194,6 +1205,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -1404,6 +1416,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -1559,6 +1573,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -1794,6 +1809,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -1892,6 +1909,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
Retention: &lokiv1.RetentionLimitSpec{
Days: 15,
Expand Down Expand Up @@ -2089,6 +2107,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 2m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -2257,6 +2277,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "2m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -2522,6 +2543,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_port: 7946
Expand Down Expand Up @@ -2647,6 +2670,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -2841,6 +2865,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_addr: ${HASH_RING_INSTANCE_ADDR}
Expand Down Expand Up @@ -2930,6 +2956,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -3095,6 +3122,8 @@ limits_config:
per_stream_rate_limit_burst: 15MB
split_queries_by_interval: 30m
query_timeout: 1m
volume_enabled: true
volume_max_series: 1000
memberlist:
abort_if_cluster_join_fails: true
advertise_addr: ${HASH_RING_INSTANCE_ADDR}
Expand Down Expand Up @@ -3184,6 +3213,7 @@ overrides:
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions operator/internal/manifests/internal/config/loki-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ limits_config:
cardinality_limit: {{ .Stack.Limits.Global.QueryLimits.CardinalityLimit }}
max_streams_matchers_per_query: 1000
query_timeout: {{ .Stack.Limits.Global.QueryLimits.QueryTimeout }}
volume_enabled: true
volume_max_series: {{ .Stack.Limits.Global.QueryLimits.MaxVolumeSeries }}
{{- if .Retention.Enabled }}{{- with .Stack.Limits.Global.Retention }}
retention_period: {{.Days}}d
{{- with .Streams }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ overrides:
{{- if $spec.QueryLimits.CardinalityLimit }}
cardinality_limit: {{ $spec.QueryLimits.CardinalityLimit }}
{{- end }}
{{- if $spec.QueryLimits.MaxVolumeSeries }}
max_volume_series: {{ $spec.QueryLimits.MaxVolumeSeries }}
{{- end }}
{{- end -}}
{{- with $spec.Retention }}
retention_period: {{ .Days }}d
Expand Down
3 changes: 3 additions & 0 deletions operator/internal/manifests/internal/sizes.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -284,6 +285,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down Expand Up @@ -340,6 +342,7 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{
MaxQuerySeries: 500,
QueryTimeout: "1m",
CardinalityLimit: 100000,
MaxVolumeSeries: 1000,
},
},
},
Expand Down

0 comments on commit 98071b1

Please sign in to comment.