Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmrule: support update_entries_limit #691

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api/v1beta1/vmrule_types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package v1beta1

import (
"net/url"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/url"
)

// MaxConfigMapDataSize is a maximum `Data` field size of a ConfigMap.
Expand Down Expand Up @@ -100,6 +101,10 @@ type Rule struct {
// Annotations will be added to rule configuration
// +optional
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
// UpdateEntriesLimit defines max number of rule's state updates stored in memory.
// Overrides `-rule.updateEntriesLimit` in vmalert.
// +optional
UpdateEntriesLimit *int `json:"update_entries_limit,omitempty" yaml:"update_entries_limit,omitempty"`
}

// VMRuleStatus defines the observed state of VMRule
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion api/victoriametrics/v1beta1/vmrule_types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package v1beta1

import (
"net/url"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/url"
)

// MaxConfigMapDataSize is a maximum `Data` field size of a ConfigMap.
Expand Down Expand Up @@ -100,6 +101,10 @@ type Rule struct {
// Annotations will be added to rule configuration
// +optional
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
// UpdateEntriesLimit defines max number of rule's state updates stored in memory.
// Overrides `-rule.updateEntriesLimit` in vmalert.
// +optional
UpdateEntriesLimit *int `json:"update_entries_limit,omitempty" yaml:"update_entries_limit,omitempty"`
}

// VMRuleStatus defines the observed state of VMRule
Expand Down
5 changes: 5 additions & 0 deletions api/victoriametrics/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/operator.victoriametrics.com_vmrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ spec:
description: Record represents a query, that will be recorded
to dataSource
type: string
update_entries_limit:
description: UpdateEntriesLimit defines max number of
rule's state updates stored in memory. Overrides `-rule.updateEntriesLimit`
in vmalert.
type: integer
type: object
type: array
tenant:
Expand Down