Skip to content

Commit

Permalink
vmrule: support update_entries_limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleygo committed Jul 18, 2023
1 parent 622cf84 commit db2dc44
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
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

0 comments on commit db2dc44

Please sign in to comment.